我已经通过
将系统区域设置为中文(简体中国)ControlPanel >> Region and Language >> Administrative >> Change System locale
然后我重新启动计算机并运行我的 .NET 4.0 应用程序。
运行
Thread.CurrentThread.CurrentCulture.Name
返回
en-GB
为什么?
最佳答案
MSDN说是
Information, such as the default culture and format patterns, is cached the first time it is requested. That information can change during the life of the AppDomain, for example, when the user modifies the regional and language options portion of Control Panel. However, the CultureInfo class does not automatically detect changes in the system settings.
先调用这个
Thread.CurrentThread.CurrentCulture.ClearCachedData();
关于c# - .NET 中的系统区域设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18127106/