tags:

views:

314

answers:

3

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?

+1  A: 

No, there are no other differences.

David M
+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
+2  A: 
AakashM
Fredrik Mörk
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