为所有线程设置默认线程文化吗? [英] Set default thread culture for all thread?

查看:77
本文介绍了为所有线程设置默认线程文化吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
设置应用程序的CurrentCulture和CurrentUICulture

Possible Duplicate:
Setting CurrentCulture and CurrentUICulture of an application

我想为我在应用程序中打开的每个线程设置默认区域性. 有没有办法设置它(无需在每个线程上单独设置)

I want to set a default culture for every thread that i open in my application. Is there a way to set it (without setting it on every thread individually)

谢谢

推荐答案

如果您使用的是.net 4.5,则可以使用以下属性

if you are using .net 4.5 you can use the below property

CultureInfo.DefaultThreadCurrentCulture属性

在.NET Framework 4和早期版本中,默认情况下,所有线程的区域性都设置为Windows系统区域性.对于当前区域性与默认系统区域性不同的应用程序,此行为通常是不希望的.在.NET Framework 4.5中,DefaultThreadCurrentCulture属性使应用程序可以定义应用程序域中所有线程的默认区域性.

http://msdn.microsoft.com/zh-cn/library/system.globalization.cultureinfo.defaultthreadcurrentculture.aspx

这篇关于为所有线程设置默认线程文化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆