简体   繁体   English

VS C#CultureInfo是否在IDE中永久设置为值?

[英]VS C# CultureInfo set permanently to value within the IDE?

I've got a German VisualStudio 9.0. 我有一个德语的VisualStudio 9.0。 Working with doubles and doing quite some parsing, I came into trouble because of the decimal separator. 使用double并进行了大量解析,由于十进制分隔符,我遇到了麻烦。

What I'm looking for is a way to either switch the whole IDE (and therefore all the projects created with it) to "en-gb" or do it project wide. 我正在寻找一种将整个IDE(以及由此创建的所有项目)切换为“ en-gb”或在整个项目范围内进行转换的方法。 I chose en-gb because of the lack of am's and pm's which I don't need. 我之所以选择en-gb,是因为我不需要AM和PM。

I tried to set it by using Thread.CurrentThread.CurrentCulture , but this regards only the one thread. 我尝试使用Thread.CurrentThread.CurrentCulture进行设置,但这仅涉及一个线程。 Then I found the Application wide setting, which seems to be not what I'm looking for when developing console applications. 然后,我发现了“应用程序范围”设置,这似乎不是我在开发控制台应用程序时要寻找的设置。

Any idea? 任何想法? Thank you for reading. 感谢您的阅读。

The culture of the application defaults to the culture of the machine it's running on, not the machine it was developed on. 应用程序的区域性默认为正在运行的计算机的区域性,而不是其开发所在的计算机的区域性。 The IDE is irrelevant here. IDE在这里无关紧要。

If you need to parse/format values using a specific culture, I suggest you do that explicitly - changing the current culture of all threads would be incorrect in almost all settings, IMO. 如果您需要使用特定区域性来解析/格式化值,我建议您明确地进行操作-更改几乎所有设置中的所有线程的当前区域性在IMO中都是不正确的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM