Non-English special folder names in Vista/Win7

心不动则不痛 提交于 2019-12-12 01:35:47

问题


In non-english versions Windows Vista and Windows 7 the usual special folders (such as the "My documents" folder) have dual naming: For instance "My documents" can be accessed (in german systems) via

C:\Users\Username\Documents

But is displayed (in explorer and file choosing dialogs) as

C:\Benutzer\Username\Eigene Dokumente

In my (C#) application, I would like to display the second form but need to use the first one internally. So I'm looking for some function to convert e.g. the result of Environment.GetFolderPath() (which is always the english name) to the localized form.

Since I do not know, how this feature is called (and my english is somehow limited), I don't even know how to google it.

Any hints are very appreciated!

Thanks Martin


回答1:


Ok, after some more research, I found out myself: The concepts I was looking for were

  • Junction points
  • Desktop.ini using the (undocumented) LocalizedResourceName entry (only documented for Windows CE)

I will open up a separate question about a function for getting this "LocalizedResourceName" automatically (I do not want to look it up manually for each directory in my path...)




回答2:


You can use Environment.SpecialFolder.MyDocuments. It should return the localized path.

Reference: Environment.SpecialFolder Enumeration



来源:https://stackoverflow.com/questions/4690832/non-english-special-folder-names-in-vista-win7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!