当Windows使用阿拉伯语UI时C#在文件中写入英文数字
我的窗户使用阿拉伯语。 当我在文件中写入数字时,它以阿拉伯语格式显示, 但我需要以英文格式编写,
尽管我在写入文件之前使用了这两行:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
并且我使用 string.Format(new CultureInfo("en-US") , myNumbers)
为什么会发生这种情况?
My windows use arabic language.
When i write numbers in a file it appears in arabic format,
but i need to write in english format,
although i use this two lines before writing to file:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
and i use string.Format(new CultureInfo("en-US") , myNumbers)
why this happen?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试指定数字格式:
当我在美国英语 Windows 7 计算机上运行以下代码时,我得到相同的结果。您期待什么格式?
123,456,789.00
123,456,789.00
Try specifying a numeric format:
When I run the following code on my US English Windows 7 machine, I get identical results. What format are you expecting?
123,456,789.00
123,456,789.00