Response.write 和区域设置
我正在使用 VB .NET 4.0、ISS 7.0。 我想知道如何为所有应用程序设置默认区域设置?
当我有 Response.Write(str) 时,问题就出现了,数字显示为“,”(德语表示法)而不是“.”(美国表示法)。
.NET从哪里知道他需要使用德语语言环境?
在我添加的每个 js 脚本中,
Session.LCID = 3081;// to fix the ,->.
但这是解决问题的强力解决方案。有没有更优雅的方式来配置服务器/.NET?
谢谢
阿曼.
I am using VB .NET 4.0, ISS 7.0.
I wondered how can I set the default locale for all applications?
The problem is rising when I have a Response.Write(str) the numbers appear with ","(german notation) rather than "."(us notation).
From where .NET knows that he need to use the german locale?
In every my js script I have added
Session.LCID = 3081;// to fix the ,->.
but this is the brute force solution to fix the problem. Are there more elegant way to configure the server/.NET?
thanks
Arman.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 app.config 中设置区域设置,
只需添加
或者,您可以通过设置当前区域性来更改应用程序线程在启动时使用的区域性:
You can set the locale in your app.config
Just add
Alternatively, you can change the culture your application thread uses at startup by setting the Current Culture:
您需要使用数字格式CultureInfo a> 选项:
例如
You need to use the
CultureInfo
in the Numeric Format options:for example