zoukankan      html  css  js  c++  java
  • 如果输入的不是英文字母或者数字或者汉字,则返回false

     public partial class Form1 : Form 

    •     { 
    •         public Form1() 
    •         { 
    •             InitializeComponent(); 
    •         } 
    •  
    •         private void button1_Click(object sender, EventArgs e) 
    •         { 
    •             string input = textBox1.Text.Trim(); 
    •             if (chkInput(input)) 
    •                 MessageBox.Show("true"); 
    •             else 
    •                 MessageBox.Show("false"); 
    •         } 
    •  
    •         /// <summary> 
    •         /// 如果输入的不是英文字母或者数字或者汉字,则返回false 
    •         /// </summary> 
    •         /// <returns></returns> 
    •         private bool chkInput(string input) 
    •         { 
    •             Regex regex = new Regex(@"^[u4E00-u9FFFA-Za-z0-9]+$"); 
    •             return regex.IsMatch(input); 
    •         } 
    •     } 
  • 相关阅读:
    myssl.com SSL 检测
    tp中model加载机制
    号码归属地
    七牛云刷新缓存
    盒子模型
    eclipse中将项目发布到tomcat的root目录
    php二维数组搜索
    linux 编译 'aclocal-1.14' is missing on your system
    windows安装 centos
    svn ignore 的用法
  • 原文地址:https://www.cnblogs.com/DTWolf/p/4660802.html
Copyright © 2011-2022 走看看