更改本地系统(NT AUTHORITY \ SYSTEM)区域设置 [英] Change localsystem (NT AUTHORITY\SYSTEM) regional settings

查看:97
本文介绍了更改本地系统(NT AUTHORITY \ SYSTEM)区域设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道是否可以通过代码(c#/c ++)更改与当前用户的本地系统帐户(如当前用户)的区域设置,以便通过代码(c#/c ++)与Windows正常连接?

我的目标是像普通用户帐户一样更改区域性信息.

我已经成功地从Windows设置中手动执行了该步骤(将当前用户和默认用户的所有设置都应用到该用户).

谢谢,

Hi,

I would to know if it''s possible to change the regional settings for the localsystem account like the current user for a normal connection with windows by code (c#/c++)?

My goal is to change the culture information like a normal user account.

I have succeed that step manualy from the windows settings (apply all settings from the current user and to the default user).

Thanks,

推荐答案

我不认为这对应用程序来说是一项体面的任务.您会发现,用户更了解她或他希望坚持哪种文化.该系统旨在为用户提供一些实现此目的的手段,而这还有其他需求.用户本人或系统管理员应更改此类系统设置,其他人不得更改.

您是否愿意考虑仅针对您的应用程序更改文化?如果完全透明并且与当前系统设置无关.
I don''t think this is a decent task for an application. You see, the user knows better what culture she or he would prefer to stick with. The system is designed to provide a user some means to do that, what else would one need. The user herself/himself or a system administrator should change such system settings, nobody else.

Would you rather consider changing the culture just for your application? If would be totally transparent and independent from the current system settings.
// culture of French, France:
System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("fr-FR");
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUiCulture = culture;



在运行环境期间,您可以从应用程序配置文件中获取所需的区域性,提供一些UI以供用户选择区域性,或类似的方法.那会更合适.

另请参阅我最近对类似问题的回答:有关转换数字格式的问题 [^ ].

—SA



During run rime, you can take the required culture from your application configuration file, provide some UI for selection of the culture by the user, or something like that. That would be much more appropriate.

See also my recent answer to a similar question: Question about convert number format[^].

—SA


设置位于
HKEY_USERS\.DEFAULT\Control Panel\International


您可以使用注册表api对其进行修改.


You can use registry apis to modify them.


我有一个类似的问题,与IIS托管的网站有关,而不是与可分发的应用有关.
查看Microsoft的这篇文章,了解如何将区域和语言设置应用于保留的帐户,而无需更改任何代码:-)
这在Windows Server 2008 R2 Standard服务器上对我有用,本文中的步骤描述了设置窗口,您应该看到的窗口与Win 2008 R2 Standard中的实际窗口有所不同...

http://windows.microsoft.com/zh-XM/windows-vista/将区域和语言设置应用于保留的帐户
I had a similar question pertaining to an IIS hosted website, not a distributable application.
Check out this article from Microsoft on how to Apply regional and language settings to reserved accounts, and you don''t need to change a single line of code :-)
This worked for me on a Windows Server 2008 R2 Standard server, steps in the article describes the settings window you should see a bit differently to what it actually looks like in Win 2008 R2 Standard...

http://windows.microsoft.com/en-XM/windows-vista/Apply-regional-and-language-settings-to-reserved-accounts


这篇关于更改本地系统(NT AUTHORITY \ SYSTEM)区域设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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