…… End If
ElseIf e.Path <> "zece.htm" '如果不是注册页面
UserName = e.Cookies("username") '从cookie中获取用户名
UserID = e.Cookies("userid") '从cookie中获取 随机ID
Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
If dr IsNot Nothing AndAlso dr("UserID") = UserID Then '如果通过验证,更新活动时候,继续访问其它页面.
dr("ActiveTime") = Date.Now '更新活动时间
Else '如果验证失败
wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
e.WriteString(wb.Build) '生成网页
Return '必须的
End If
End If
'开始生成网页
Select Case e.path
Case "logon.htm" '登录页面
wb.AddPageTitle("","pageheader","销售系统","由湛江辉迅基于Foxtable开发")
If e.PostValues.ContainsKey("username") AndAlso e.PostValues.ContainsKey("password") Then '判断是否是验证失败后的重新登录
wb.AddTopTips("","toptip1","用户名或密码错误!").msec = 2000 '如果用户通过登录按钮访问,则给用户一个2秒的提示.
End If
wb.AddForm("","form1","logon.htm")
With wb.AddInputGroup("form1","ipg1")
.AddInput("username","户名","text")
.AddInput("password","密码","password")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "登录", "submit")
.Add("btn2", "注册", "","zece.htm")
End With
Case "zece.htm"
‘注册页面的代码’
……