程序代码 <% 'check to see if the client is connected If Response.IsClientConnected Then Response.Flush Else response.End End If %>
再附上一个函数:
程序代码 <% Function IsConnectedAfter(Seconds) Dim StartTime Dim PauseTime
IsConnectedAfter = True StartTime = Now
Do While DateDiff("s", StartTime, Now) < Seconds PauseTime = Now Do While DateDiff("s", PauseTime, Now) < 1 'Do Nothing Loop Response.Write "." If Response.IsClientConnected = False then IsConnectedAfter = False Exit Function End If
Loop End Function
if IsConnectedAfter(3) then response.write("online") 'offline是不会显示的 ^_^ if not IsConnectedAfter(3) then response.write("offline") %>