08. C#中的字符(2)
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
char c = e.KeyChar;
if (char.IsLetter(c))
label1.Text = "字母";
else if (char.IsDigit(c))
label1.Text = "数字";
else if (char.IsPunctuation(c))
label1.Text = "标点";
else
label1.Text = "其他";
}