简单的方法来设置的CurrentCulture为整个应用程序?方法来、应用程序、简单、CurrentCulture

2023-09-04 07:31:13 作者:时光如梦梦如烟*

在一个.NET 2 WinForms应用程序,有什么好办法来设置文化为整个应用程序? 设置CurrentThread.CurrentCulture为每一个新线程是重复的,容易出错。 理想情况下,我想,当设置它的应用程序启动并忘掉它。

In a .net 2 winforms application, what's a good way to set the culture for the entire application? Setting CurrentThread.CurrentCulture for every new thread is repetitive and error-prone. Ideally I'd like to set it when the app starts and forget about it.

推荐答案

文化在.NET中的线程是培养系统(如图所示由单个应用程序/进程)。有没有办法覆盖,在.NET中,你必须继续设置的CurrentCulture为每一个新的线程。

The culture for a thread in .NET is the culture for the system (as viewed by a single application/process). There is no way to override that in .NET, you'll have to continue setting the CurrentCulture for each new thread.