|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。统计|在线|在耳目数<%
countonlineuserwithoutusingGlobal.asa
scriptbyNarongKhotarasakit
webmasterofezebox.com
reportbug:info@ezebox.com
sessionID=session.SessionID
timeout=5
sethowlongtokeepthissessioninminuteyoucanincreasethisnumber
Conn_String="DRIVER={MicrosoftAccessDriver(*.mdb)};DBQ="&Server.MapPath("count.mdb")
Conn_String="activeUser"
setyourDSN="activeuser"isabetterwaybecauseyouneedincludethisfiletoallyouraspscripts.
SetConnCount=Server.CreateObject("ADODB.Connection")
ConnCount.OpenConn_String
deletesessionaftertimeout
aaa=dateadd("n",-timeout,now())
connCount.Execute("delete*fromcountwherepostdate<#"&aaa&"#")
keepsessionID
sql0="selectsessfromcountwheresess="&sessionID&""
setrscheck=connCount.Execute(sql0)
ifrscheck.eofthen
sql="insertintocount(sess,postdate)values("&sessionID&","&now()&")"
connCount.Execute(sql)
endif
rscheck.close
setrscheck=nothing
countsessionID
sql2="selectcount(sess)fromcount"
setrs=connCount.Execute(sql2)
count=rs(0)
rs.close
setrs=nothing
sql3="select*fromcount"
setrspredel=connCount.Execute(sql3)
dountilrspredel.eof
xxx=DateDiff("n",rspredel("postdate"),Now())
ifxxx>timeoutthen
count=count-1
endif
rspredel.movenext
loop
rspredel.close
setrspredel=nothing
connCount.Close
setconnCount=nothing
ifcount=0then
count=1
endif
%>
<%=count%>Activeusers
</p>问题是他们究竟是喜欢他们是使用软件时,速度快还是速度慢好.(当然在3秒以内).无论是他们输入资料时,查找资料时,分析资料时. |
|