msgbox(0.1)
Dim fl As String = "d:\test\" & e.path
msgbox(0.2)
If filesys.FileExists(fl)
Dim idx As Integer = fl.LastIndexOf(".")
Dim ext As String = fl.SubString(idx)
Select Case ext
Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".rar",".txt"
e.WriteFile(fl)
Return '这里必须返回
End Select
End If
msgbox(0.4)
Dim wb As New weui
msgbox(0.5)
'身份验证
Dim Verified As Boolean '用于标记用户是否通过了身份验证
Dim UserID As String = e.Cookies("userid") '从cookie中获取用户名
Dim PassWord As String = e.Cookies("password") '从cookie中获取用户密码
If e.Path = "login.htm" '如果是通过登录页面访问,从PostValues即可中提取用户名和密码
If e.PostValues.ContainsKey("userid") AndAlso e.PostValues.ContainsKey("password") Then
UserID = e.PostValues("userid")
PassWord = e.PostValues("password")
End If
End If
msgbox(1)
'验证密码
Dim cmd As New SQLCommand
Dim dt As DataTable
Dim dr As DataRow
cmd.ConnectionName = DataSource
cmd.CommandText = "Selec t * Fro m {用户管理} Where [用户编号] = '" & UserID & "'"
dt = cmd.ExecuteReader
If dt.DataRows.Count > 0 Then
dr=dt.DataRows(0)
If PassWord=DecryptText(dr("登录密码") ,"zhgg","1111111") Then
Verified = True
End If
End If
msgbox(2)
If Verified AndAlso e.Path = "login.htm" Then '如果用户访问的是登录页,且身份验证成功
wb.AppendCookie("userid",UserID) '将用户名和密码写入cookie
wb.AppendCookie("password",PassWord)
wb.AppendCookie("depname",dr("部门名称"))
wb.InsertHTML("<meta http-equiv='Refresh' c>") '直接跳转到首页
e.WriteString(wb.Build) '生成网页
Return '必须的
ElseIf Verified = False AndAlso e.Path <> "login.htm" Then '如果用户身份验证失败,且访问的不是登录页面
wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
e.WriteString(wb.Build) '生成网页
Return '必须的
End If
msgbox(3)
'开始生成网页
Select Case e.path
Case "login.htm" '登录页面
Functions.Execute("Web_Login",e)
Case "exit.htm" '退出登录
Functions.Execute("Web_Exit",e)
Case "", "default.htm" '首页
Functions.Execute("Web_Default",e)
Case "qtnlist.htm"
Functions.Execute("Web_QtnList",e)
Case "goodsquery.htm"
Functions.Execute("Web_GoodsQuery",e)
Case "goodslist.htm"
Functions.Execute("Web_GoodsList",e)
Case "goodsqtn.htm"
Functions.Execute("Web_GoodsQtn",e)
End Select
应该不是这的错误吧,我MSGBOX都写到最顶点了,刷新网页会引发窗口事件?
现在是现弹出错误,才弹出0.1