PC中的区域和语言设置在.Net中被忽略 [英] PC Regional and Language Settings are being ignored in .Net

查看:165
本文介绍了PC中的区域和语言设置在.Net中被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我并不孤单,但我还没有找到解决方案。

I know I'm not alone in this, but I'm yet to find a solution.

我的电脑区域和语言设置都是英文(英国)但是.Net正在使用美国格式的日期和货币。

My PC Regional and Language settings are all English (United Kingdom) but .Net is using US formats for dates and currencies.

我检查了机器配置和Web配置,没有全球化设置,我不想

I've checked the machine config and web config and there are no globalization settings and I don't want to add them.

在某处我错过了另一个设置?

Is there another setting somewhere I've missed?

推荐答案

您使用ASP.NET标签:我怀疑您正在运行的应用程序的身份没有自己的配置文件,它使用的默认区域设置存储在注册表中的HKEY_USERS.Default\Control Panel\国际。

You use the ASP.NET tag: I suspect you are running the application under an identity without its own profile, and it is using the default regional settings stored in the registry under 'HKEY_USERS.Default\Control Panel\International`.

这些不一定与交互式用户的区域设置相同。

These aren't necessarily the same as the regional settings of an interactive user.

您可以做一个两件事:


  • < global> 元素添加到你的web.config。这可能是最好的解决方案,因为它使您的应用程序独立于托管服务器的区域设置。

  • Add a <globalization> element to your web.config. This is probably the best solution, as it makes your app independent of the regional settings of the hosting server.

使用控制面板设置所需的区域设置为当前用户和默认用户配置文件。确切的步骤取决于您使用的Windows版本。

Use Control Panel to set the regional settings you want for the current user and for the default user profile. The exact steps depend on the Windows version you're using.

这篇关于PC中的区域和语言设置在.Net中被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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