Mega Code Archive

 
Categories / C# Book / 07 Stream
 

0576 Special Folders

We can use the GetFolderPath method in the System.Environment class to get the special folder. using System; using System.IO; using System.Linq; using System.Text; class Program { static void Main() { string myDocPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); Console.WriteLine(myDocPath); } } The output: C:\Users\abc\Documents