How to use C # To obtain the path of a special folder in the system
Source: Internet
Author: User
Files cannot be written to drive c under win7. Currently, users can only write files to their own user folders, such as MyDocuments and folders. Use c # To obtain the directory of these folders:
Copy codeThe Code is as follows: string path = System. Environment. GetFolderPath (Environment. SpecialFolder. MyDocuments );
Environment. SpecialFolder enumeration description:
The CommonApplicationData Directory, which is used as a public repository of application-specific data for all users.
The directory where Cookies are used as the public repository of Internet Cookies.
Favorites is used as the directory of the public repository for user Favorites items.
The directory where InternetCache is used as a public repository for Internet temporary files.
MyComputer "my computer" folder.
MyPictures "My Pictures" folder.
SendTo directory that contains the "send" menu item.
Startup corresponds to the directory of the user's "start" program group.
The directory where Templates is used as the public repository for document Templates.
The directory where Personal is used as the public repository of the document.
ProgramFiles "Program files" directory.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service