get path to windows special folders
Published: 8. January 2009 | Updated: 8. January 2009License: Microsoft Public License (MS-PL)
Categories: Windows
Tags: C# File System Windows
string myDocumentsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); Console.WriteLine(myDocumentsPath); string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); Console.WriteLine(desktopPath);Console Output:
C:\Documents and Settings\Administrator\My Documents
C:\Documents and Settings\Administrator\Desktop
C:\Documents and Settings\Administrator\Desktop
| Send us feedback about this snippet » |





