Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4133212
  • 博文数量: 70
  • 博客积分: 5010
  • 博客等级: 大校
  • 技术积分: 1400
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-27 15:06
文章存档

2011年(2)

2010年(23)

2009年(21)

2008年(24)

我的朋友

分类:

2008-10-16 11:40:16

 //控制密码的大小写:不允许使用大写字母  
    string pattern = @"^[^A-Z]*$";
   Match m = Regex.Match(this.textBoxNew.Text.Trim(), pattern);   // 匹配正则表达式
                        if (!m.Success) 
                        {
                            MessageBox.Show("您的密码输入了大写字母或开启了Caps Lock键,请重新输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            this.textBoxNew.Focus();
                            return;
                        }
 
阅读(848) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~