以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 密码字符 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=113645) |
-- 作者:良才 -- 发布时间:2018/1/19 22:27:00 -- 密码字符 密码必须是6-16个字母或数字组成,请老师指教,谢谢! Dim str = e.Form.Controls("密码").Text
Dim reg = New System.Text.RegularExpressions.Regex("^[A-Za-z0-9]+$") If reg.Ismatch(str) = False OrElse str.Length < 6 And str.Length > 16 Then MessageBox.Show("密码必须是6-16个字母或数字组成 !","提示", MessageBoxButtons.OK,MessageBoxIcon.Question) e.Form.Controls("密码").Select() Return End If |
-- 作者:有点蓝 -- 发布时间:2018/1/19 22:36:00 -- If reg.Ismatch(str) = False OrElse str.Length < 6 OrElse str.Length > 16 Then |
-- 作者:良才 -- 发布时间:2018/1/21 14:51:00 -- 谢谢 |