feiyucha

实现效果:

  

知识运用:

  

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            if (Validate(textBox1.Text.ToString()))
                MessageBox.Show("验证通过");
            else
                MessageBox.Show("输入不符合");
        }
        //定义方法
        public bool Validate(string str) {
            return System.Text.RegularExpressions.
                Regex.IsMatch(str,@"^\d{16,18}$");
        }

 

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-12-24
  • 2021-12-13
  • 2021-11-20
  • 2022-01-06
  • 2022-01-01
  • 2021-12-23
  • 2021-11-30
猜你喜欢
  • 2022-02-11
  • 2021-12-23
  • 2021-12-25
  • 2022-01-07
  • 2022-02-09
  • 2021-12-02
相关资源
相似解决方案