字符串到单个 [英] String to Single

查看:77
本文介绍了字符串到单个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我软件的用户正在获得此例外:


从字符串0.5转换为输入''Single''是无效的。


我有大约30个其他用户在运行

相同代码时没有得到此异常在我的开发PC上从未见过它。至于

我可以看到转换0.5并没有错。一个数字。

有没有人知道为什么他可能会遇到这个问题而且没有

其他人?


他是使用键盘设置以英语运行Windows,设置为

瑞典语。

A user of my software is getting this exception:

Conversion from string "0.5" to type ''Single'' is not valid.

I have about 30 other users who do not get this exception when running
the same code and I have never seen it on my development PCs. As far
as I can see there is nothing wrong with converting "0.5" to a number.
Does anyone have any idea why he might experience this problem and no
one else?

He is running Windows in English with the keyboard settings, set to
Swedish.

推荐答案

" Olie" < ow **** @ gmail.comschrieb
"Olie" <ow****@gmail.comschrieb

我的软件的用户正在获得此例外:


转换来自字符串0.5输入''Single''是无效的。


我有大约30个其他用户没有得到这个例外

运行相同的代码而我从来没有见过我的开发

PC。据我所知,转换

0.5并没有错。一个数字。有没有人知道他为什么会遇到这个问题而没有其他人?


他用英文键盘设置运行Windows,设置为

瑞典语。
A user of my software is getting this exception:

Conversion from string "0.5" to type ''Single'' is not valid.

I have about 30 other users who do not get this exception when
running the same code and I have never seen it on my development
PCs. As far as I can see there is nothing wrong with converting
"0.5" to a number. Does anyone have any idea why he might experience
this problem and no one else?

He is running Windows in English with the keyboard settings, set to
Swedish.



操作系统语言和键盘设置并不重要。更重要

是区域设置。


字符串的来源是什么?0.5?从文件?用户输入?

Armin

The OS language and the keyboard settings is not important. More important
are the regional settings.

What''s the source of the string "0.5"? From a file? User input?
Armin


他告诉我区域设置设置为英语。使用以下代码从Xml文件中读取字符串



昏暗变焦单身


zoom = XmlNode.Attributes(" Zoom")。值


我不认为我使用的是Single.Parse()但也许我需要。我没有

在我面前有代码所以这是来自内存。


来源的来源是否重要。肯定一个字符串是

字符串,无论它来自哪里。

He tells me the regional settings are set to English. The string is
being read from an Xml file using the code:

Dim zoom As Single

zoom = XmlNode.Attributes("Zoom").Value

I do not think I used Single.Parse() but maybe I need to. I do not
have the code in front of me so this is from memory.

Does it matter where the source comes from. Surely a string is a
string wherever it came from.


他不能将区域设置设置为英语。我只是尝试运行该软件,并将区域设置设置为芬兰语,并且

给出了他提到的错误。


感谢您的提示!你知道怎么解决这个问题吗?将Single.Parse()

处理这个吗?

He can not have the regional settings set to English. I just tried
running the software with the regional settings set to Finnish and it
gives you exactly the error he mentions.

Thanks for the hint! Do you know how to fix this? Will Single.Parse()
deal with this?


这篇关于字符串到单个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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