谁能告诉我 Application.CurrentCulture
和 Thread.CurrentCulture
之间的区别。
线程有CurrentCulture
和CurrentUICulture
。但是 Application 只有 CurrentCulture
。为什么?
我指的是下面提到的这个链接:
最佳答案
Application.CurrentCulture
委托(delegate)给 Thread.CurrentThread.CurrentCulture
(“获取或设置当前线程的文化信息”),因此它仅为应用程序的主线程设置它。在 .NET 4.5 中,您可以使用 CultureInfo.DefaultThreadCurrentCulture
改变 AppDomain 文化的属性。
这是 source Application.CurrentCulture
的:
public static CultureInfo CurrentCulture
{
get {
return Thread.CurrentThread.CurrentCulture;
}
set {
Thread.CurrentThread.CurrentCulture = value;
}
}
关于c# - Application.CurrentCulture 和 Thread.CurrentCulture 之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29644594/