如何判断输入的字符是否含数字
private void textBox1_TextChanged(object sender, EventArgs e) { char[] ch = textBox1.Text.ToCharArray(); bool IsChinese = true; int ch_start = Convert.ToInt32("4e00", 16); int ch_end = Convert.ToInt32("9fff", 16); foreach ( char c in ch) { if (Convert.ToInt32(c) < ch_start | Convert.ToInt32(c) > ch_end) { IsChinese = false; break; } } if (IsChinese == false) { MessageBox.Show("您输入了非中文字符","提示"); } }