login.htm登录时
下面红色的可以正常验证,粉色的不能验证
Dim e As RequestEventArgs = args(0) '登录验证码
Select Case e.Path
Case "getVimg.htm"
If e.PostValues.Count > 0 Then
'Dim wb As New weui
Dim shoujh As String = e.PostValues("isj") '验证手机是否空值
Dim dr As DataRow '定义输入的手机号,所在的行(以便于下面代码内查找此行)
Dim mim As String = e.PostValues("imm") '验证手机是否空值
Dim yanzm As String = e.PostValues("yzm") '验证手机是否空值
Dim cookie_yzm As String = e.Cookies("yanzhengma") '从cookie中获取验证码
Dim pattern As String = "^[1][345789][0-9]{9}$" '手机验证用
Dim txt = shoujh
Dim rgx = new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
If shoujh = "" Then
msgbox("手机为空,getVimg.htm!")
e.WriteString("手机不能为空!")
'Return ""
ElseIf rgx.isMatch(txt) = False Then '手机号验证不正确
msgbox("手机:已经验证位数|字母等,getVimg.htm!")
e.WriteString("请正确输入手机号码!")
'Return ""
ElseIf rgx.isMatch(txt) = True Then '手机号验证正确,查找有没有这个用户
dr = DataTables("会员资料").sqlFind("手机 = '" & shoujh & "'")
'msgbox("行,已经找了!")
If dr Is Nothing Then '如果没有这个手机号
e.WriteString("您尚未注册,花2分钟注册,就可以免费参与哦!")
'Return ""
End If
ElseIf mim = "" Then
e.WriteString("密码不能为空!")
'Return ""
ElseIf mim <> "" AndAlso mim.Length < 6 Then
e.WriteString("请正确输入密码!")
'Return ""
ElseIf mim <> "" AndAlso mim.Length > 12 Then
e.WriteString("请正确输入密码!")
'Return ""
ElseIf yanzm = "" Then
e.WriteString("验证码不能为空!")
'Return ""
ElseIf yanzm <> cookie_yzm Then
e.WriteString("请正确输入验证码!")
'Return ""
Else
e.WriteString("OK")
End If
'wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
'e.WriteString(wb.Build)
ElseIf e.GetValues.ContainsKey("rand")
***生成验证码
End Select
[此贴子已经被作者于2017/4/6 15:30:05编辑过]