In .NET what is the difference between Environment.CurrentDirectory and Directory.GetCurrentDirectory()? Of course, Environment.CurrentDirectory is a property which can be set and obtained. Are there any other differences?
views:
314answers:
3
+1
Q:
What is the difference between Environment.CurrentDirectory and Directory.GetCurrentDirectory?
+2
A:
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.
Fredrik Mörk
2009-07-22 12:23:43
Fredrik Mörk
2009-07-22 12:51:26
I think it is more a logical difference that is the cause of this. It is a natural property in the Environment context, but in Directory, it is more a "directory related" utility function.
awe
2009-07-22 12:54:43