public bool isNumber(string mystr){
try{
int i = int.Parse(mystr);
return true;
}
catch {
return false;
}
}使用if (! isNumber(textBox1.text)) {
MessageBox.Show("只能数字啦,说几次了老是不听 ^o^");
}
try{
int i = int.Parse(mystr);
return true;
}
catch {
return false;
}
}使用if (! isNumber(textBox1.text)) {
MessageBox.Show("只能数字啦,说几次了老是不听 ^o^");
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货