如何更改.net Web应用程序中的默认区域性设置? [英] how to change default culture settings in a .net web application?

查看:87
本文介绍了如何更改.net Web应用程序中的默认区域性设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的Web应用程序(.net/C#)使用amount.ToString("c")格式化货币金额,显示为本地化到几个不同的区域.

我们的法国Candian用户更喜欢将所有金额都设为美国格式(123,456.99,而fr-CA的默认窗口方式为123456,99).

处理此问题的最佳方法是什么?我可以简单地在Windows中为fr-ca修改每个Web服务器上的区域设置吗?还是我需要创建自定义文化?

解决方案

您可能希望研究创建自定义区域性,并提供所需的格式规则组合. 在MSDN上有一篇文章介绍了如何做.. >

简而言之,您将创建一个 CultureAndRegionInfoBuilder a>对象,定义名称,设置属性并注册.查看文章以了解详细信息.

Our web application (.net/C#) formats currency amounts using amount.ToString("c"), shown localized to a few different regions.

Our French Candian users prefer all amounts to be the US format (123,456.99 vs. the default windows way for fr-CA of 123 456,99).

What is the best way to handle that ? Can I simply modify the regional settings on each webserver in windows for fr-ca? or do I need to create a custom culture?

解决方案

You may want to look into creating a custom culture, providing the mix of formatting rules that you requre. There is an article at MSDN describing how to do it.

In short, you create a CultureAndRegionInfoBuilder object, define the name, set properties, and register it. Check the article for details.

这篇关于如何更改.net Web应用程序中的默认区域性设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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