老师,代码如下,但是不行:Public Sub thread_sub1(ByVal e as RequestEventArgs)
Dim sb As New StringBuilder
sb.AppendLine("<!doctype html>")
sb.AppendLine("<html>")
sb.appendLine("<head>")
sb.AppendLine("<meta charset='gb2312'>")
sb.AppendLine("<meta name='viewport' c>")
sb.appendLine("</head>")
sb.AppendLine("<body>")
Dim wb As New weui
e.Resp
Dim zd As String = e.path
Dim dw As Integer = zd.IndexOf(".")
zd = zd.SubString(0,dw)
If zd > "" Then
Dim qd As String = Functions.Execute("checkname",zd)
If qd = 1 Then
Functions.Execute(zd,e)
Else
e.WriteString("正在建设中,请期待!")
End If
End If
sb.AppendLine("</body>")
sb.AppendLine("</html>")
End Sub
过程没有问题,可以通过。
但是在httprequest事件启用多线程时代码如下:
Dim nthread As New System.Threading.Thread(AddressOf thread_sub1)
nthread.start(e)
就会出错。多线程代码要怎么写?