<small id='QOsax'></small><noframes id='QOsax'>

  • <tfoot id='QOsax'></tfoot>

      • <bdo id='QOsax'></bdo><ul id='QOsax'></ul>

      1. <legend id='QOsax'><style id='QOsax'><dir id='QOsax'><q id='QOsax'></q></dir></style></legend>
        <i id='QOsax'><tr id='QOsax'><dt id='QOsax'><q id='QOsax'><span id='QOsax'><b id='QOsax'><form id='QOsax'><ins id='QOsax'></ins><ul id='QOsax'></ul><sub id='QOsax'></sub></form><legend id='QOsax'></legend><bdo id='QOsax'><pre id='QOsax'><center id='QOsax'></center></pre></bdo></b><th id='QOsax'></th></span></q></dt></tr></i><div id='QOsax'><tfoot id='QOsax'></tfoot><dl id='QOsax'><fieldset id='QOsax'></fieldset></dl></div>

        以编程方式更改“区域和语言"操作系统设置

        时间:2023-08-27

            <tbody id='QLJEy'></tbody>

            <legend id='QLJEy'><style id='QLJEy'><dir id='QLJEy'><q id='QLJEy'></q></dir></style></legend>
            • <tfoot id='QLJEy'></tfoot>
              <i id='QLJEy'><tr id='QLJEy'><dt id='QLJEy'><q id='QLJEy'><span id='QLJEy'><b id='QLJEy'><form id='QLJEy'><ins id='QLJEy'></ins><ul id='QLJEy'></ul><sub id='QLJEy'></sub></form><legend id='QLJEy'></legend><bdo id='QLJEy'><pre id='QLJEy'><center id='QLJEy'></center></pre></bdo></b><th id='QLJEy'></th></span></q></dt></tr></i><div id='QLJEy'><tfoot id='QLJEy'></tfoot><dl id='QLJEy'><fieldset id='QLJEy'></fieldset></dl></div>

                  <bdo id='QLJEy'></bdo><ul id='QLJEy'></ul>

                  <small id='QLJEy'></small><noframes id='QLJEy'>

                • 本文介绍了以编程方式更改“区域和语言"操作系统设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我希望能够从 C# 程序更改操作系统 (Windows 7) 的区域和语言 设置.我并不反对执行命令行命令,但我只知道如何启动 Region and Language 对话框:control/name Microsoft.RegionAndLanguage

                  I'd like to be able to change the Region and Language settings of the operating system (Windows 7) from a C# program. I'm not against executing command-line commands but I've only gotten as far as discovering how to launch the Region and Language dialog: control /name Microsoft.RegionAndLanguage

                  这是一个语言本地化问题,其中 ControlDateTimePicker 只能使用 Windows Region and Language 设置(请参阅此处的 详情);然而,更新操作系统以符合应用程序的语言设置超出了此范围,最终成为预期目标.

                  This is a language localisation problem where Controls like DateTimePicker can only use the Windows Region and Language settings (see here for details); however updating the operating system to conform to the application's language settings extends beyond this and is ultimately the desired goal.

                  我们将不胜感激建议和/或解决方法.

                  Suggestions and/or workarounds would be appreciated.

                  推荐答案

                  我设法实现的唯一解决方案是修改注册表.在 Windows 7 中,更改语言时,会在注册表的子项中添加一个新条目:HKEY_CURRENT_USERControl PanelDesktop.此键将包含 REG_MULTI_SZ 类型的条目 PreferredUILanguagesPending,其值将确定 UI 语言.要应用更改,当前用户需要注销并再次登录.这可以使用以下代码完成:

                  The only solution I managed to implement was to modify the registry. In Windows 7, when the language is changed, a new entry is added to the Registry in the subkey: HKEY_CURRENT_USERControl PanelDesktop. This key will contain the entry PreferredUILanguagesPending of type REG_MULTI_SZ and its value will determine the UI language. For the change to be applied the current user needs to log off and log in again. This can be done using the following code:

                  RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Control PanelDesktop", true);
                  string[] lang = {"en-ZA"};
                  key.SetValue("PreferredUILanguagesPending", lang, RegistryValueKind.MultiString);
                  

                  语言包需要安装才能设置.如需语言包列表,请查看此处或这里.当安装超过 1 个语言包时,更改 UI 语言的选项将出现在 Control Panel >地区和语言 >键盘和语言 >显示语言.

                  The language pack needs to be installed before it can be set. For a list of language packs check here or here. When more than 1 language pack is installed option to change the UI language will appear in Control Panel > Region and Language > Keyboards and Languages > Display language.

                  这篇关于以编程方式更改“区域和语言"操作系统设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:resx 文件是否适合国际化? 下一篇:如何为枚举使用用户友好的名称?

                  相关文章

                  最新文章

                • <i id='bR4jR'><tr id='bR4jR'><dt id='bR4jR'><q id='bR4jR'><span id='bR4jR'><b id='bR4jR'><form id='bR4jR'><ins id='bR4jR'></ins><ul id='bR4jR'></ul><sub id='bR4jR'></sub></form><legend id='bR4jR'></legend><bdo id='bR4jR'><pre id='bR4jR'><center id='bR4jR'></center></pre></bdo></b><th id='bR4jR'></th></span></q></dt></tr></i><div id='bR4jR'><tfoot id='bR4jR'></tfoot><dl id='bR4jR'><fieldset id='bR4jR'></fieldset></dl></div>
                • <small id='bR4jR'></small><noframes id='bR4jR'>

                    <bdo id='bR4jR'></bdo><ul id='bR4jR'></ul>
                  <legend id='bR4jR'><style id='bR4jR'><dir id='bR4jR'><q id='bR4jR'></q></dir></style></legend>
                  <tfoot id='bR4jR'></tfoot>