非常奇怪的是“输入字符串格式不正确”窃听器 [英] Very strange "input string not in correct format" bug

查看:50
本文介绍了非常奇怪的是“输入字符串格式不正确”窃听器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序的一个用户遇到异常输入字符串不是

格式正确。但它在哪里发生毫无意义。当来自文本框(172)的字符串被转换为Int16

(使用Convert.ToInt16)时,会发生
。怎么可能?还有其他文本框

以相同的方式使用它们并没有产生异常。

所有有很多其他机器在运行我的应用程序根本不会产生




我不知道问题是什么,我正在寻找想法。

One user of my application is experiencing an exception "input string not in
correct format". But it makes no sense where it is occurring. It is
occurring when a string from a textbox ("172") is being convert to an Int16
(using Convert.ToInt16). How can that be? There are other text boxes that
are used in the identical fashion and they don''t generate the exception.
All there are many other machines running my application that don''t generate
the exception at all.

I have no idea what the problem could be and am looking for ideas.

推荐答案

Jen< no ** @ nowhere.comwrote:
Jen <no**@nowhere.comwrote:

我的应用程序的一个用户遇到异常输入字符串不在

格式正确。但它在哪里发生毫无意义。当来自文本框(172)的字符串被转换为Int16

(使用Convert.ToInt16)时,会发生
。怎么可能?还有其他文本框

以相同的方式使用它们并没有产生异常。

所有有很多其他机器在运行我的应用程序根本不会产生




我不知道问题是什么,我正在寻找想法。
One user of my application is experiencing an exception "input string not in
correct format". But it makes no sense where it is occurring. It is
occurring when a string from a textbox ("172") is being convert to an Int16
(using Convert.ToInt16). How can that be? There are other text boxes that
are used in the identical fashion and they don''t generate the exception.
All there are many other machines running my application that don''t generate
the exception at all.

I have no idea what the problem could be and am looking for ideas.



你能发一个简短但完整的程序来演示

的问题吗?


http://www.pobox.com/~skeet/csharp/ complete.html 了解详情

我的意思是什么。


-

Jon Skeet - < ; sk *** @ pobox.com>
http://www.pobox .com / ~siget 博客: http://www.msmvps.com /jon.skeet

如果回复群组,请不要给我发邮件

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


我可以发布相关的代码片段但我怀疑我能否重现

问题。它只在一台机器上出现,大约有十几个被测试过。

Jon Skeet [C#MVP]" < sk *** @ pobox.com写了留言

新闻:MP ************************ @ msnews。 microsoft.c om ...
I can post the relevant code snippets but I doubt I can reproduce the
problem. It''s only occuring on one machine out of about a dozen tested.
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...

Jen< no ** @ nowhere.comwrote:
Jen <no**@nowhere.comwrote:

>我的应用程序的一个用户遇到异常输入字符串不是
格式正确。但它在哪里发生毫无意义。当文本框(172)中的字符串被转换为
Int16
时(使用Convert.ToInt16),就会发生这种情况。怎么可能?还有其他文本框
以相同的方式使用它们并没有产生异常。
所有有很多其他机器运行我的应用程序不是
生成
异常。

我不知道问题是什么,我正在寻找想法。
>One user of my application is experiencing an exception "input string not
in
correct format". But it makes no sense where it is occurring. It is
occurring when a string from a textbox ("172") is being convert to an
Int16
(using Convert.ToInt16). How can that be? There are other text boxes
that
are used in the identical fashion and they don''t generate the exception.
All there are many other machines running my application that don''t
generate
the exception at all.

I have no idea what the problem could be and am looking for ideas.



你能发一个简短但完整的程序来演示

的问题吗?


http://www.pobox.com/~skeet/csharp/ complete.html 了解详情

我的意思是什么。


-

Jon Skeet - < ; sk *** @ pobox.com>
http://www.pobox .com / ~siget 博客: http://www.msmvps.com /jon.skeet

如果回复群组,请不要给我发邮件


Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too



Jen< no ** @ nowhere.comwrote:
Jen <no**@nowhere.comwrote:

我可以发布相关的代码片段,但我怀疑我能否重现

问题。它只在一台机器上出现,大约有十几个测试过。
I can post the relevant code snippets but I doubt I can reproduce the
problem. It''s only occuring on one machine out of about a dozen tested.



您能否生成一个简短但完整的程序,该程序在单个

机器上失败? (一个控制台应用程序将是最简单的。)


这听起来很奇怪...


-

Jon Skeet - < sk *** @ pobox.com>
http: //www.pobox.com/~skeet 博客: http:// www.msmvps.com/jon.skeet

如果回复小组,请不要给我发邮件

Can you produce a short but complete program that fails on that single
machine? (A console app would be easiest.)

It does sound very odd...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


这篇关于非常奇怪的是“输入字符串格式不正确”窃听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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