学无先后达者为师!
不忘初心,砥砺前行。

Windows、Linux 和 macOS 上的 Environment.SpecialFolder 枚举

在使用 C# 开发跨平台应用程序时,可以使用 Environment.GetFolderPath 方法来避免对路径的硬编码。

ENM: System.Environment.SpecialFolder.AdminTools
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Administrative Tools
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.ApplicationData
WIN: C:\Users\soar360\AppData\Roaming
LIN: /home/soar360/.config
OSX: /Users/soar360/Library/Application Support

ENM: System.Environment.SpecialFolder.CDBurning
WIN: C:\Users\soar360\AppData\Local\Microsoft\Windows\Burn\Burn
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonAdminTools
WIN: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonApplicationData
WIN: C:\ProgramData
LIN: /usr/share
OSX: /usr/share

ENM: System.Environment.SpecialFolder.CommonDesktopDirectory
WIN: C:\Users\Public\Desktop
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonDocuments
WIN: C:\Users\Public\Documents
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonMusic
WIN: C:\Users\Public\Music
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonOemLinks
WIN: empty
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonPictures
WIN: C:\Users\Public\Pictures
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonProgramFiles
WIN: C:\Program Files\Common Files
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonProgramFilesX86
WIN: C:\Program Files (x86)\Common Files
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonPrograms
WIN: C:\ProgramData\Microsoft\Windows\Start Menu\Programs
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonStartMenu
WIN: C:\ProgramData\Microsoft\Windows\Start Menu
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonStartup
WIN: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.CommonTemplates
WIN: C:\ProgramData\Microsoft\Windows\Templates
LIN: /usr/share/templates
OSX: /usr/share/templates

ENM: System.Environment.SpecialFolder.CommonVideos
WIN: C:\Users\Public\Videos
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.Cookies
WIN: C:\Users\soar360\AppData\Local\Microsoft\Windows\INetCookies
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.Desktop
WIN: C:\Users\soar360\Desktop
LIN: /home/soar360/Desktop
OSX: /Users/soar360/Desktop

ENM: System.Environment.SpecialFolder.DesktopDirectory
WIN: C:\Users\soar360\Desktop
LIN: /home/soar360/Desktop
OSX: /Users/soar360/Desktop

ENM: System.Environment.SpecialFolder.Favorites
WIN: C:\Users\soar360\Favorites
LIN: empty
OSX: /Users/soar360/Library/Favorites

ENM: System.Environment.SpecialFolder.Fonts
WIN: C:\WINDOWS\Fonts
LIN: /home/soar360/.fonts
OSX: /Users/soar360/Library/Fonts

ENM: System.Environment.SpecialFolder.History
WIN: C:\Users\soar360\AppData\Local\Microsoft\Windows\History
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.InternetCache
WIN: C:\Users\soar360\AppData\Local\Microsoft\Windows\INetCache
LIN: empty
OSX: /Users/soar360/Library/Caches

ENM: System.Environment.SpecialFolder.LocalApplicationData
WIN: C:\Users\soar360\AppData\Local
LIN: /home/soar360/.local/share
OSX: /Users/soar360/Library/Application Support

ENM: System.Environment.SpecialFolder.LocalizedResources
WIN: empty
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.MyComputer
WIN: empty
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.MyDocuments
WIN: C:\Users\soar360\Documents
LIN: /home/soar360
OSX: /Users/soar360

ENM: System.Environment.SpecialFolder.MyMusic
WIN: C:\Users\soar360\Music
LIN: /home/soar360/Music
OSX: /Users/soar360/Music

ENM: System.Environment.SpecialFolder.MyPictures
WIN: C:\Users\soar360\Pictures
LIN: /home/soar360/Pictures
OSX: /Users/soar360/Pictures

ENM: System.Environment.SpecialFolder.MyVideos
WIN: C:\Users\soar360\Videos
LIN: /home/soar360/Videos
OSX: /Users/soar360/Videos

ENM: System.Environment.SpecialFolder.NetworkShortcuts
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\Network Shortcuts
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.Personal
WIN: C:\Users\soar360\Documents
LIN: /home/soar360
OSX: /Users/soar360

ENM: System.Environment.SpecialFolder.PrinterShortcuts
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\Printer Shortcuts
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.ProgramFiles
WIN: C:\Program Files
LIN: empty
OSX: /Applications

ENM: System.Environment.SpecialFolder.ProgramFilesX86
WIN: C:\Program Files (x86)
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.Programs
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.Recent
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\Recent
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.Resources
WIN: C:\WINDOWS\resources
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.SendTo
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\SendTo
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.StartMenu
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\Start Menu
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.Startup
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.System
WIN: C:\WINDOWS\system32
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.SystemX86
WIN: C:\WINDOWS\SysWOW64
LIN: empty
OSX: empty

ENM: System.Environment.SpecialFolder.Templates
WIN: C:\Users\soar360\AppData\Roaming\Microsoft\Windows\Templates
LIN: /home/soar360/Templates
OSX: /Users/soar360/Templates

ENM: System.Environment.SpecialFolder.UserProfile
WIN: C:\Users\soar360
LIN: /home/soar360
OSX: /Users/soar360

ENM: System.Environment.SpecialFolder.Windows
WIN: C:\WINDOWS
LIN: empty
OSX: empty
赞(1) 打赏
未经允许不得转载:码农很忙 » Windows、Linux 和 macOS 上的 Environment.SpecialFolder 枚举

评论 抢沙发

给作者买杯咖啡

非常感谢你的打赏,我们将继续给力更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

登录

找回密码

注册