NoGlobal. asaCan the number of online users be counted?
<%
SessionID = session. SessionID
Timeout = 5
'SetSessionRetention Time.
Conn_String = "DRIVER = {Microsoft Access Driver (*. mdb)}; DBQ =" & Server. MapPath ("count. mdb ")
'Conn _ String = "activeUser"
'Best settingDSN = "activeuser ",Because we needASPThe script contains this file..
Set ConnCount = Server. CreateObject ("ADODB. Connection ")
ConnCount. Open Conn_String
Aaa = dateadd ("n",-timeout, now ())
ConnCount. Execute ("delete * from count where postdate <#" & aaa &"#")
'Delete after timeoutSession.
Sql0 = "select sess from count where sess = '" & sessionID &"'"
'PersistenceSessionID.
Set rscheck = connCount. Execute (sql0)
If rscheck. eof then
SQL = "insert into count (sess, postdate) values ('" & sessionID & "', '" & now ()&"')"
ConnCount. Execute (SQL)
End if
Rscheck. close
Set rscheck = nothing
Sql2 = "select count (sess) from count"
'ComputingSessionID.
Set rs = connCount. Execute (sql2)
Count = rs (0)
Rs. close
Set rs = nothing
Sql3 = "select * from count"
Set rspredel = connCount. Execute (sql3)
Do until rspredel. eof
Xxx = DateDiff ("n", rspredel ("postdate"), Now ())
If xxx> timeout then
Count = count-1
End if
Rspredel. movenext
Loop
Rspredel. close
Set rspredel = nothing
ConnCount. Close
Set connCount = nothing
If count = 0 then
Count = 1
End if
%>
Currently<% = Count %>People dance with the wind!
[1]