Dim e As RequestEventArgs = args(0)
Dim path = args(1)
wb = new weui
If e.PostValues("扫描结果")=Nothing
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","scan1")
With wb.AddInputGroup("form1","ipg1","扫描")
.AddInput("扫描结果","扫描结果","Text")
End With
With wb.AddButtonGroup("form1","btg1",False)
.Add("btn1", "扫一扫", "button").Attribute = " & path & "/plus/barcode_scan.html\',true,true);"""
End With
wb.AppendHTML("<script src=\'./lib/scan1.js\'></script>") \'引入脚本文件
\'wb.InsertHTML("<script>Function scaned( t, r, f ) {If(r.indexOf(\'http\') == 0 || r.indexOf(\'www\') == 0){location=\'http://\' + r.replace(\'http://\', \'\');}else{If(r.indexOf(\'zcbh-\') == 0){location=\'./zcbh\';}else{document.getElementById(\'扫描结果\').value=r;}}</script>")
\' wb.InsertHTML("<script>function scaned( t, r, f ) {if(r.indexOf(\'http\') == 0 || r.indexOf(\'www\') == 0){location=\'http://\' + r.replace(\'http://\', \'\');}else{document.getElementById(\'扫描结果\').value=r;}}</script>")
e.WriteString(wb.Build)
Else
Dim r As Row=Tables("扫描").addnew()
r("扫描")=e.PostValues("扫描结果")
Tables("扫描").save()
With wb.AddTable("","Table1")
\' .CreateFromDataTable(DataTables("扫描"),True)
End With
e.WriteString(wb.Build)
End If