'通用事件头,用于发送已经存在的常见文件
Dim fl As String = "c:\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 "count.htm"
Dim wb As New weui
Dim sb As New StringBuilder
sb.AppendLine("<script src='http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js'></script>")
sb.AppendLine("<script>")
sb.AppendLine("var c=0;")
sb.AppendLine("var t;")
sb.AppendLine("function timedCount(){")
sb.AppendLine("document.getElementById('xm').value=c;")
sb.AppendLine("c=c+1;")
sb.AppendLine("sendAjaxText('1','active.htm','',false);")
sb.AppendLine("t=setTimeout('timedCount()',2000);")
sb.AppendLine("}")
sb.AppendLine("$(document).ready(function () {")
sb.AppendLine("timedCount();")
sb.AppendLine("});")
sb.AppendLine("</script>")
wb.AppendHTML(sb.ToString,True)
With wb.AddInputGroup("","ipg1","计时")
.AddInput("xm","0","text").Readonly = True
End With
e.WriteString(wb.Build) '生成网页
Case "active.htm"
StatusBar.Message2 = val(StatusBar.Message2) + 1
End Select