实现效果:
知识运用:
实现代码:
private void button1_Click(object sender, EventArgs e) { if (System.Text.RegularExpressions.Regex.IsMatch(textBox1.Text, "^.{8,}$")) label2.BackColor = Color.Green; else label2.BackColor = Color.Red; }