经过一晚瞎捣鼓,移动开发指南weui框架第一个页面示例测试成功,但是接下来几个都没有成功,
命令窗口启动:
HttpServer.Prefixes.Add("http://127.0.0.1/")
HttpServer.Prefixes.Add("http://*/")
HttpServer.Start()
以下是“文本输入框”代码,放在HttpRequest事件,浏览器输入http://127.0.0.1/text.htm,浏览器(谷歌、2345)没有反应,还请指导
注:框架文件放在E盘根目录
'通用事件头,用于发送已经存在的常见文件
Dim fl As String = "e:\web\" & e.path
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"
e.WriteFile(fl)
Return '这里必须返回
End Select
End If
Select Case e.Path
Case "test.htm"
Dim wb As New weui
wb.AddForm("","form1","text.htm")
With wb.AddInputGroup("form1","ipg1","登录")
.AddInput("xm","户名","text")
.AddInput("pw","密码","password")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit")
End With
e.WriteString(wb.Build) '生成网页
End Select