Dim e As RequestEventArgs = args(0) '登录验证码
Select Case e.Path
Case "getVimg.htm"
If e.PostValues.Count > 0 Then
Dim shoujh As String = e.PostValues("isj") '验证手机是否空值
Dim mim As String = e.PostValues("imm") '验证手机是否空值
Dim yanzm As String = e.PostValues("yzm") '验证手机是否空值
Dim cookie_yzm As String = e.Cookies("yanzhengma") '从cookie中获取验证码
If shoujh = "" Then ’如何改写这里
e.WriteString("请正确填入手机号!")
end if
Dim e As RequestEventArgs = args(0) '登录页面
Select Case e.Path
Case "login.htm"
Dim wb As New weui
If e.PostValues.Count = 0 Then
wb.AddTopTips("","toptip1","") '用于显示动态错误提示
wb.AddForm("","form1","login.htm").A-ttri-bute = "on-sub-mit = 're-turn va-lidit_login()'"
With wb.AddInputGroup("form1","ipg1","登录")
If e.PostValues.ContainsKey("isj") AndAlso e.PostValues.ContainsKey("imm") Then '判断是否是验证失败后的重新登录
wb.AddTopTips("","toptip1","用户名或密码错误!").msec = 2000 '如果用户通过登录按钮访问,则给用户一个2秒的提示.
End If
With .AddInputCell("ic1") '通过InputCell增加输入框(1表示突出显示,2表示红色警示图标)
.AddLabel("lsj","手机",0) '增加标签(0显示在左边)
.AddInput("isj","text",1).PlaceHolder= "请输入手机号" '增加输入框(0靠左显示,1居中显示,2靠右显示)
End With
With .AddInputCell("ic2")
.AddLabel("lmm","密码",0)
.AddInput("imm","password",1).PlaceHolder= "请输入密码"
End With
With .AddInputCell("ic5") '通过InputCell增加输入框
.AddLabel("lyzm","验证码",0) '增加标签,0显示在左边
.AddInput("yzm","text",1) '增加输入框,1表示显示在中间
.AddImage("pim","/getVimg.htm?rand=1",2).A-ttri-bute ="on-click=""thi-s.src = 'getVimg.htm?ran-d='+ + Math.ran-dom()""" '增加一个图片,2比表示显示在右边
End With
'.AddSwitch("jizhumima","记住密码").Value = "是" '此行已注释
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "登录","submit") '"/index.htm")
End With
With wb.AddButtonGroup("form1","btg2", False)
.Add("btn2", "免费注册","","/register.htm").Kind = 1
.Add("btn3", "忘记密码","","/getback.htm").Kind = 1
End With
End With
wb.AppendHTML("<script src='./lib/ajaxform_login.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
End If
End Select