备忘:.NET的CultureInfo
2015-12-16 15:57
211 查看
使用C#进行开发时如果碰到需要使用CultureInfo而又没有显示指定时(例如:DateTime的ToString,string.Format等)会发生什么呢?
Console程序:程序默认会从Thread.CurrentThread.CurrentCulture获取CultureInfo,而该CultureInfo来自执行程序的登录用户在控制面板中的地区和语言的配置。
WindowService:
如果该WindowService是以某个OS用户的身份运行的,则程序默认会读取该用户在地区和语言中的配置;
如果该WindowService是以LocalSystem运行的,程序默认会从注册表的"HKEY_USERS/.DEFAULT/Control Panel/International"中获取;
引用自:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/8fbca78b-5078-4a12-8abb-4051076febbb/c-windows-service-culture-info-problem
相关链接:
How does a .NET process get the culture information?
Default Culture in a Windows Service
Add the Log on as a service right to an account
ANSI Code Page for Windows System Locale with Identifier Constants and Strings
The .Default user is not the default user
Console程序:程序默认会从Thread.CurrentThread.CurrentCulture获取CultureInfo,而该CultureInfo来自执行程序的登录用户在控制面板中的地区和语言的配置。
WindowService:
如果该WindowService是以某个OS用户的身份运行的,则程序默认会读取该用户在地区和语言中的配置;
如果该WindowService是以LocalSystem运行的,程序默认会从注册表的"HKEY_USERS/.DEFAULT/Control Panel/International"中获取;
引用自:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/8fbca78b-5078-4a12-8abb-4051076febbb/c-windows-service-culture-info-problem
相关链接:
How does a .NET process get the culture information?
Default Culture in a Windows Service
Add the Log on as a service right to an account
ANSI Code Page for Windows System Locale with Identifier Constants and Strings
The .Default user is not the default user
相关文章推荐
- XShell自定义配色方案
- MSSql数据库锁
- plsql创建用户名及表空间
- crontab命令
- 自学习 与 无监督特征学习
- Linux NTP配置详解 (Network Time Protocol)
- springMVC+spring+hibernate配置
- vsftpd配置文件详解
- 十大免费又好用的网络分析工具
- Spring 3.x 入门学习
- 向Openstack贡献代码
- Android使用ViewPagerIndicator、RecyclerView搭建UI
- 基于LingPipe的文本基本极性分析【demo】
- STM32的EXTI小实验
- spring的事务嵌套
- BugPhobia开发篇章:Beta阶段第III次Scrum Meeting
- Win7禁用USB接口、Win7禁用组策略、win7禁用便携设备的方法
- 更改log4j.properties不能去掉debug信息的问题
- bzoj1449【JSOI2009】球队收益
- 黑马程序员_java API-String&&StringBuffer