【发布时间】:2015-02-23 00:57:19
【问题描述】:
String t = textBox1.Text;
int a = int.Parse(t);
if( a < 24)
{
MessageBox.Show("24 over.");
textBox1.Clear();
}
“System.FormatException”类型的未处理异常发生在 mscorlib.dll 附加信息:输入字符串不正确 格式
如何将String类型的值改为整数类型的值?
【问题讨论】:
-
你的 textBox1.Text 里有什么?
-
textBox1只是输入数字。
-
好的,但是当你运行你的代码时它包含什么?
标签: formatexception