What is the difference between Environment.CurrentDirectory and Directory.GetCurrentDirectory?

前端 未结 3 2037
刺人心
刺人心 2021-02-11 17:00

In .NET what is the difference between:

  • Environment.CurrentDirectory
  • Directory.GetCurrentDirectory()?

Of course

3条回答
  •  无人共我
    2021-02-11 17:37

    As David says: they do the same thing. Internally, when getting Environment.CurrentDirectory it will call Directory.GetCurrentDirectory and when setting Environment.CurrentDirectory it will call Directory.SetCurrentDirectory.

    Just pick a favorite and go with it.

提交回复
热议问题