Copyright statement: This article is an original article of CSDN blogger "Sakura Flower", which follows the CC 4.0 BY-SA copyright agreement. For reprinting, please attach the original source link and this statement.
Original link: https://blog.csdn.net/qq_37192571/article/details/117926242
Obtain the operating system path summary (red is commonly used)
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);//Get the system desktop directory path.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);//Get the directory path of the "My Documents" folder.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.Favorites); // Get the directory path of the public repository for the user's favorite items.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.Startup);//Get the directory path of the user's "Startup" program group.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.Recent);//Get the directory path of the user's recently used documents.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.StartMenu);//Get the directory path of the "Start" menu item.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic);//Get the directory path of the "My Music" folder.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyComputer);//Get the "My Computer" folder path.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.Templates); // Get the directory path of the public repository of document templates.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.PrinterShortcuts);//Get the file system directory, including the link object path that may exist in the "Printer" virtual folder.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache); //Get the directory path of the public repository for temporary Internet files.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.History); //Get the directory path of the public repository of Internet history items.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); // Get the common repository path it uses as application specific data used by all users.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.System); //Get the "System" directory path.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); //Get the "Program files" directory path.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);//Get the path of the "My Pictures" folder.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86); //Get Windows "System" folder path x86.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); //Get "Program Files" folder path x86.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles);//Get the directory path of the components shared between applications.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86); //Get the "Program Files" folder path x86.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.CommonMusic); //Get repository path for music files shared by users.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.CommonPictures); //Get repository path for image files shared by users.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.CommonVideos); //Get the repository path for video files shared by users.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.CDBurning); // Get the file system directory that acts as a staging area path for files waiting to be written to CD.
- string dir = Environment.GetFolderPath(Environment.SpecialFolder.Personal); // Get the directory path of the public repository for the documentation.