Use C to get the path to the system's special folder

  • 2020-05-12 03:04:47
  • OfStack

win7 cannot write files to c disk. At present, users can only write files to their own user folders, such as MyDocuments, folders. The directory method to get these folders by using c# is:

string path=System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);  
Environment.SpecialFolder  Enumeration description:  
CommonApplicationData  Directory, which serves as a common repository for application-specific data used by all users.    
Cookies  Used as a  Internet Cookie  Directory of the common repository.    
Favorites  A directory that serves as a common repository for user favorites.    
InternetCache  Used as a  Internet  Directory of the common repository for temporary files.    
MyComputer  "My computer" folder.     
MyPictures  " My Pictures "Folder.    
 SendTo  The directory that contains the send menu item.    
Startup  Directory that corresponds to the user's startup application group.   
Templates  The directory that serves as a common repository for document templates.    
Personal  A directory that serves as a common repository for documents.    
ProgramFiles  " Program files "Directory.  

Related articles: