Dim fl As String = ProjectPath & "web\" & e.path
Dim path As String = "foxtableAppTest"
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
Select Case e.path
Case "test.htm"
If e.PostValues.count = 0 Then
Dim wb As new weui
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/common.js'></script>", True)
wb.AppendHTML("<link rel='stylesheet' href='/" & path & "/css/common.css' Type='text/css' charset='utf-8'/>", True)
wb.AddForm("","form1","test.htm")
With wb.AddInputGroup("form1","ipg1","测试")
.AddInput("姓名","姓名","Text")
.AddInput("年龄","年龄","text")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "扫一扫", "button").Attribute = "onclick=""clicked('" & path & "/plus/barcode_scan.html',True,True);"""
End With
wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById('年龄').value=r;}</script>")
' wb.InsertHTML("<script>function scaned( t, r, f ) {plus.nativeUI.alert('扫描返回的信息如:\n编码:' + t + '\n内容:' + r + '\n图片存放路径(在手机端):' + f);}</script>")
e.WriteString(wb.Build)
Else
Tables("表A").current("第一列")=e.PostValues("姓名")
Tables("表A").current("第二列")=e.PostValues("年龄")
Dim sb As New StringBuilder
sb.AppendLine("<meta name='viewport' c>")
sb.AppendLine("接收到的数据有:<br/><br/>")
For Each key As String In e.PostValues.Keys
sb.AppendLine(key & ":" & e.PostValues(key) & "<br/>")
Next
e.WriteString(sb.ToString)
End If
End Select