谁能告诉我和之间的Application.CurrentCulture
区别Thread.CurrentCulture
。
线程有CurrentCulture
和CurrentUICulture
。但应用程序只有CurrentCulture
. 为什么?
我指的是下面提到的这个链接:
谁能告诉我和之间的Application.CurrentCulture
区别Thread.CurrentCulture
。
线程有CurrentCulture
和CurrentUICulture
。但应用程序只有CurrentCulture
. 为什么?
我指的是下面提到的这个链接:
Application.CurrentCulture
委托给Thread.CurrentThread.CurrentCulture
(“获取或设置当前线程的文化信息”),因此它只为应用程序的主线程设置它。在 .NET 4.5 中,您可以使用该CultureInfo.DefaultThreadCurrentCulture
属性来更改 AppDomain 的区域性。
这里的来源:Application.CurrentCulture
public static CultureInfo CurrentCulture
{
get {
return Thread.CurrentThread.CurrentCulture;
}
set {
Thread.CurrentThread.CurrentCulture = value;
}
}