如题,如果在a.aspx中运行System.Threading.Thread.CurrentThread.Sleep(60000)之后,则不能打开其它页面,如b.aspx,一定要等a.aspx处理完并结束后(即断开a页面的连接),才可以打开其它页面,不知何解?代码如下:
Application.Add(CustomID , Response)'保存连接用户的response对象入application
Do
If Response.IsClientConnected Then
Try
System.Threading.Thread.CurrentThread.Sleep(60000) '每一分钟检测一次客户端是否在线,不在线则退出。
Catch ex As Exception
End Try
Else
Application.Remove(CustomID )'如果用户断开连接则移除application相关值。
Exit Do
End If
Loop
Application.Add(CustomID , Response)'保存连接用户的response对象入application
Do
If Response.IsClientConnected Then
Try
System.Threading.Thread.CurrentThread.Sleep(60000) '每一分钟检测一次客户端是否在线,不在线则退出。
Catch ex As Exception
End Try
Else
Application.Remove(CustomID )'如果用户断开连接则移除application相关值。
Exit Do
End If
Loop
为此解析此问题,特写另一段代码,结束还是不行的,苦恼中:
Application.Add(CustomID , Response)
Dim i As Byte
Do
If Response.IsClientConnected Then
Try
Response.Flush()
Dim mydl As New myDelay(30)
Dim t As New System.Threading.Thread(AddressOf mydl.myStart)
t.Priority = Threading.ThreadPriority.BelowNormal
t.Start()
t.Join()
Catch ex As Exception
End Try
Else
Application.Remove(CustomID )
Exit Do
End If
LoopPublic Class myDelay
Private i As Int32
Public Sub New()
i = 0
End Sub
Public Sub New(ByVal intSecond As Int16)
i = intSecond * 1000
End Sub
Public Sub myStart()
System.Threading.Thread.CurrentThread.Sleep(i)
End Sub
End Class
这不会是asp.net的漏洞吧?