不使用Global.asa实现在线人数统计
<%
sessionID = session.SessionID
timeout = 5
' 设置保持SESSION的时间,你可以增加这个数值
Conn_String = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("count.mdb")
'Conn_String = "activeUser"
'设置你的 DSN = "activeuser" 是一个很好的方法,因为你需要你需要把这个文件包含到所有的ASP脚本里
Set ConnCount =Server.CreateObject("ADODB.Connection")
ConnCount.Open Conn_String
' 超时以后删除SESSION
aaa = dateadd("n", -timeout, now())
connCount.Execute ("delete * from count where postdate 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
%>
Active users

