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\Documentsjava2s.com | | Contact Us | Privacy Policy |
| Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
| All other trademarks are property of their respective owners. |