如何更改现有Windows用户的语言? [英] How do I change the language for existing windows users?

查看:347
本文介绍了如何更改现有Windows用户的语言?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为Windows OS中的所有用户设置欢迎屏幕和UI语言。对于新用户,更改应用完美,当前用户也是如此(使用XML Answer文件通过intl.cpl)。我无法设置的现有用户。怎么解决这个问题?有没有其他方法可以实现这个?如果您遇到过这个问题,请分享您的知识。使用C#.net代码



我尝试了什么:



我试图通过c#code.some条件更改一些注册表肯定会失败

解决方案

操作系统确定要显示的语言。如果你坚持覆盖它(不好主意),在你初始化应用程序时这样做:



 System.Threading.Thread.CurrentThread .CurrentCulture =  new  CultureInfo(Properties.Settings.Default.language); 
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(Properties.Settings.Default.language);


语言存储在注册表的用户特定部分(用户目录中的文件 NTUSER.DAT )。



当用户登录后,您可以使用 regedit 或Windows访问 HKEY_USERS \< SID> 中的用户设置从具有管理权限的程序调用的API注册表函数。使用程序时,必须首先枚举用户以获取他们的SID。



当用户未登录时,可以使用注册 [ ^ ]实用程序。例如,参见修改其他用户的注册表 [< a href =http://www.adminarsenal.com/admin-arsenal-blog/modifying-the-registry-of-another-user/\"target =_ blanktitle =New Window> ^ ]。

虽然这不是C#解决方案,但是执行命令或将它们写入可以被执行的shell脚本应该没问题。


我所做的是从文本文件加载UI语言。用户登录后。它将改为用户优先语言。所有文本都来自资源文件。例如:

Resources-Errors.en-US.resx

Resources-Errors.nl-NL.resx



 Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(Properties.Settings.Default.DefaultLanguage); 


I'm trying to set the welcome screen and UI language for all the users in windows OS.For new user the changes applied perfectly and current user as well(using XML Answer file passing through intl.cpl). Existing user I couldn't set. how to solve this issue? Is any other method i could achieve this?? Please share ur knowledge if you have experienced this problem.using C#.net code

What I have tried:

I tried to change some registry through c# code.some conditions certainly it fails

解决方案

The OS determines the language to display. If you insist on overriding it (bad idea), do this when you init your app:

System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(Properties.Settings.Default.language);
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(Properties.Settings.Default.language);


The language is stored in the user specific part of the registry (file NTUSER.DAT in the user directory).

When the user is logged in, you can access the user settings at HKEY_USERS\<SID> using regedit or the Windows API registry functions called from a program with administrative privileges. When using a program, the users must be enumerated first to get their SIDs.

When the user is not logged in, the registry can be edited offline using the Reg[^] utility. See for example Modify the Registry of Another User[^].
While this is not a C# solution, it should be no problem to execute the commands or write them to a shell script that can then be xecuted.


What I have done is loading the UI-language from a text file. After the user has been loggedvin. It wil change to the user preffered language. All the text comes from resource files. for example:
Resources-Errors.en-US.resx
Resources-Errors.nl-NL.resx

Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(Properties.Settings.Default.DefaultLanguage);


这篇关于如何更改现有Windows用户的语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆