#32004/10/2 10:08:20
跳转可以用response.redirect方法
统计在线人数
<%
dim RefreshTime ,IdleTime,TotalUsers,OnlineUser(),Tmp(),Num,I,ID
RefreshTime=10
IdleTime=RefreshTime*3
Application.Lock
If Application("TotalUsers")=Empty Then Application("TotalUsers")=0
If Application(TotalUsers")=Empty Then Application("TotalUsers")=0
Redim Tmp(Application("TotalUsers")+1)
Num=0
If Application("TotalUsers")>0 Then
For I=LBOUND(Application("OnlineUser")) To UBOUND(Application("OnlineUser"))
ID=Application("OnlineUser")(I)
If ID<>Session.SessionID Then
Tmp(Num)=ID
Num=Num+1
End If
Next
End If
Tmp(Num)=Session.SessionID
Application("TotalUsers")=Num+1
ReDim Preserve Tmp(Application("TotalUsers"))
Application("OnlineUser")=Tmp
End If
Application(Session.SessionID&"LastAccessTime")=Timer
ReDim Tmp(Application("TotalUsers"))
Num=0
For I=0 To Application("TotalUsers")-1
ID=Application("OnlineUser")(I)
If (Timer-Application(ID&"LastAccessTime"))<IdleTime Then
Tmp(Num)=ID
Num=Num+1
Else
Application(ID&"LastAccessTime")=Empty
End If
Next
If Num<>Application("TotalUsers") Then
ReDim Preserve Tmp(Num)
Application("OnlineUser")=Tmp
Application("TotalUsers")=Num
End If
Application.Unlock
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Refresh" CONTENT="<%RefreshTime%>,URL=<%=
Request.ServerVariables("PATH_INFO")%>">
</HEAD>
<BODY>
目前在线的人数:<%Application("TotalUsers")%>
</BODY>
</HTML>