c# - .NET 中的系统区域设置

标签 c# locale culture

我已经通过

将系统区域设置为中文(简体中国)
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/

相关文章:

java - (Android) 更改语言无法正常工作

c# - 解析法国日期

c# - 写一个sql存储过程来删除表中的数据?

javascript - 根据首选语言使用 Bing Translate API 进行 Bot Framework Node.js 翻译

c# - 从 C# 中的同一个流中读取多次

php - tidy_parse_string 更改之前使用 setlocale 设置的区域设置

sql - 当值与字符串相互转换时,SQL Server 是否考虑文化/区域设置?

c# - 一种不那么丑陋的本地化 DayOfWeek 的方法?

c# - 检索 asp :TextBox 的值

c# - 调用结果对等待任务的影响