您的位置: bluesailor散记——
« 字段为空,存储过程参数用VS2008编写校验用户名是否存在 »

利用正则验证用户名,asp.net

分类: .net学习调试笔记 发布: admin 浏览: 日期: 2008年10月4日

引用 using System.Text.RegularExpressions;

            string txtUserName = UserName.Text;
            Regex reg = new Regex(@"[a-z0-9_\u4e00-\u9fa5]{3,20}");
            if (!reg.IsMatch(txtUserName))
            {
                userLabel.Text = "用户名不可用";
                return;
            }

相关文章:

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-Blog 1.8 Spirit Build 80722

Copyright Lunji.com Some Rights Reserved.