⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 在线列表.asp

📁 这是一个压缩包
💻 ASP
字号:
'<%
'application.Lock 
'application("counter")= application("counter")+1
'application.UnLock
' %>
 <%
 dim refreshtime,idletime,totalusers,onlineuser(),tmp(),num,i,id
 refeshtime=10
 idletime=refeshtime*3
 application.Lock()
 if application(session.SessionID&"lastaccesstime")=empty then
   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("totalusers")=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>
<title>在线列表</title>
      <meta http-equiv="refresh" content="<%=refeshtime %>,url=<%=request.ServerVariables("PATH_INFO")%>">
	  </head>
    <body>
      目前在线人数为: <% =application("totalusers")%>
    </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -