Function for getting localized path?(获取本地化路径的功能?)
问题描述
Windows 7(可能还有 Windows Vista)使用 desktop.ini 文件中的 LocalizedResourceName 条目显示本地化文件夹名称.对于我的 Documents 文件夹,这看起来像
Windows 7 (and probably Windows Vista) display localized folder names using the LocalizedResourceName entry in the desktop.ini file. For my Documents folder, this looks like
[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%system32shell32.dll,-21770
IconResource=%SystemRoot%system32imageres.dll,-112
IconFile=%SystemRoot%system32shell32.dll
IconIndex=-235
(请参阅这个问题)
这样,资源管理器在德语 Windows 上将路径C:UsersUsernameDocuments"显示为C:BenutzerUsernameDokumente".
This way the explorer displays the path "C:UsersUsernameDocuments" as "C:BenutzerUsernameDokumente" on a german Windows.
我想知道,是否有任何内置的 shell 函数可以自动获取此本地化名称,或者甚至更好地将整个路径转换为其本地化形式(最好是 .NET 中的任何内容)?
I wonder, if there's any build-in shell function to automatically get this localized name or, even better, transform a whole path into its localized form (best would be anything in .NET)?
这更有趣,因为 LocalizedResourceName 条目仅针对 Windows CE 进行了记录(请参阅 这里).
This is even more interesting as the LocalizedResourceName entry is only documented for Windows CE (see here).
谢谢
马丁
推荐答案
SHGetLocalizedName().Michael Kaplan 的博客上有一个 PInvoke 示例.
SHGetLocalizedName(). There is a PInvoke sample on Michael Kaplan's blog.
这篇关于获取本地化路径的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:获取本地化路径的功能?
基础教程推荐
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 将数据集转换为列表 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- 如果条件可以为空 2022-01-01
