用一个RegularExpressValidator好了

解决方案 »

  1.   

    private void button_Click(object sender, System.EventArgs e)
    {
      Regex r = new Regex(@"^13(0|1|3)\d{8}$");
      Match m = r.Match(this.textBox.Text);
      if(!m.Success)
        MessageBox.Show("Invalid");
    }
      

  2.   

    Regex和Match需要using什么东西?
    找不到类型或命名空间名称“Regex”(是否缺少 using 指令或程序集引用?)
    找不到类型或命名空间名称“Match”(是否缺少 using 指令或程序集引用?)