上网课遇到问题的小菜鸟一枚,希望大佬能够帮忙解决,谢谢了。
this.textBox2.Text不是合法的整数,比如说有空格,为空 等等
this.textBox2.Text 如果是空值的话你要先判断下 string.IsNullOrEmpty( this.textBox2.Text) ? 0: int.Parse( this.textBox2.Text);