0

我正在开发一个与 ArcGis ArcMap 10 和 10.1 一起使用的应用程序。我的应用程序是我添加到 Arcmap 的一个 dll(它是一个工具栏)。当我在我的机器上调试时,它工作正常(Windows server 2003 和 ArcGis 10)。但是在另一台机器上,即带有 ArcGis 10.1 的 Windows server 2008 上,将双精度值转换为字符串时,小数分隔符变为逗号 (,) 而不是点 (.)。如果我使用 cstr(variable) 或 text = variable 或 text=variable.tostring 将 double 变量转换为字符串,我总是得到一个逗号而不是一个点。

两台机器上的区域设置都是正确的。我尝试使用以下代码设置区域性,但出现“实例是只读的”错误。但我在 ArcGis 10 机器上没有收到此错误。

My.Application.Culture.NumberFormat.NumberDecimalSeparator = "."
System.Threading.Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol = "."

奇怪的是,当我查看 ArcGis 10.1 中的数字时,分隔符就是重点。所以问题似乎出在我的应用程序 dll 中。

有人能帮我吗?

4

1 回答 1

4

试试下面的代码

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Application.CurrentCulture = New CultureInfo("EN-US")
End Sub
于 2013-07-11T21:57:26.680 回答