本文介绍了C#更改系统语言环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
需要将系统区域设置更改为其他国家/地区,我尝试使用SystemParametersInfo()和GetKeyboardLayout()并没有帮助.
Need to change the system locale to a different country, I have tried SystemParametersInfo(), GetKeyboardLayout() which didn't help.
如何在C#中更改控制台应用程序的系统区域设置?
How would I change the system locale in C# for a console application?
推荐答案
例如
Thread.CurrentThread.CurrentCulture = new CultureInfo("es-AR"); // Espanol - Argentina
Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-AR");// Espanol - Argentina
例如,
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); // English - US
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");// English - US
这篇关于C#更改系统语言环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!