调试看看能不能从cookie取到正确的值
Else '其它页面从Cookie提取登录信息进行验证
UserName = e.Cookies("username") '从cookie中获取用户名
msgbox("UserName=" & UserName)
UserID = e.Cookies("userid") '从cookie中获取 随机ID
msgbox("UserID =" & UserID )
Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
msgbox(dr IsNot Nothing)
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