'开始生成网页前面这一段建议就保留在httprequest好了。
各个case里的内容再放到函数里,函数里自己定义自己的【Dim wb As New weui】,然后都调用e.WriteString
比如logon函数
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
wb.AddPageTitle("","pageheader","个人应用系统","--夜 语--")
'wb.AddPageFooter("","pf1","Copyright © 2008-2016 foxtable.com").AddLink("底部链接","http://www.foxtable.com")
wb.AddPageFooter("","pf1","京")
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")
End With
e.WriteString(wb.Build)
…………………………
Select Case e.path
Case "logon.htm" '登录页面
Functions.Execute("logon",e)
Case "exit.htm" '退出登录
Functions.Execute("exit",e)
Case "", "default.htm" '首页
Functions.Execute("default",e)
End Select
‘这里最后一句必须去掉e.WriteString(wb.Build)