开发者

Non-English special folder names in Vista/Win7

开发者 https://www.devze.com 2023-02-04 13:41 出处:网络
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)

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开发者_JAVA技巧 is somehow limited), I don't even know how to google it.

Any hints are very appreciated!

Thanks Martin


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...)


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

Reference: Environment.SpecialFolder Enumeration

0

精彩评论

暂无评论...
验证码 换一张
取 消