Environment.SpecialFolder

In case you didn’t know about it, in .NET there is a fantastic Enumeration that is a part of the “Environment” static class that basically gives you the folder paths to a couple dozen different specific local directories on a computer. The enumeration has come a long way since its .NET 2.0 days and now in .NET 4.5 offers ways of accessing ProgramFiles for 32BIT and 64BIT, provides access to Printer and Network Shortcuts, and event CommonMusic / CommonPictures on Windows vs MyMusic and MyPictures. Obviously it is not incredibly helpful in writing ASP.NET apps, but very helpful in Windows and Console applications.

Check it out:

http://msdn.microsoft.com/en-us/library/system.environment.specialfolder(v=vs.110).aspx

Leave a Reply