How to

get path to windows special folders

Published: 8. January 2009 | Updated: 8. January 2009
License: Microsoft Public License (MS-PL)
Categories: Windows
Tags: C# File System Windows
Was this snippet helpful for you? YESYES / NONO
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
Send us feedback about this snippet »



Related Snippets: