System.FormatException
HResult=0x80131537
Message=输入字符串的格式不正确。
Source=mscorlib
StackTrace:
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Int32.Parse(String s)
遇到这种问题,就是字符串大概率包含了非数字的其他字符。过滤 掉或者在转换的时候提前检验一下字符串,然后弹窗提示。