private void button2_Click(object sender, EventArgs e)
{ char a1;
try
{
a1 = Convert.ToChar(textBox1.Text);
if (char.IsDigit(a1))
{
MessageBox.Show("你输入的是数字!!");
textBox1.Focus(); textBox1.Text = "";
}
else if (char.IsLetter(a1))
{
MessageBox.Show("你输入的是字符!!");
textBox1.Focus(); textBox1.Text = "";
}
else
{
MessageBox.Show("你输入的不对啊!!");
textBox1.Focus();
textBox1.Text = "";
}
}
catch
{
MessageBox.Show("你输入的不是一个吧!!");
}
}