不用Global.asa也能实现统计在线人数吗?

2023-12-05 0 725

不用Global.asa也能实现统计在线人数吗?

<%sessionID = session.SessionIDtimeout = 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_Stringaaa = dateadd(\”n\”, -timeout, now())connCount.Execute (\”delete * from count where postdate < #\” & aaa & \”#\”)\’ 在超时后删除session.sql0 = \”select sess from count where sess=\’\” & sessionID & \”\’\”

\’ 保持sessionID.set rscheck = connCount.Execute (sql0)if rscheck.eof thensql = \”insert into count (sess,postdate) values(\’\” & sessionID & \”\’, \’\” & now() & \”\’)\”connCount.Execute (sql)end ifrscheck.closeset rscheck = nothingsql2 = \”select count(sess) from count\”

\’ 计算sessionID.set rs = connCount.Execute (sql2)count = rs(0)

rs.closeset rs = nothingsql3 = \”select * from count\”set rspredel = connCount.Execute (sql3)do until rspredel.eofxxx=DateDiff(\”n\”, rspredel(\”postdate\”), Now())if xxx > timeout thencount = count-1end ifrspredel.movenextlooprspredel.closeset rspredel = nothingconnCount.Closeset connCount = nothingif count = 0 thencount = 1end if%>当前正有<%=count%>人在随风起舞流连忘返!

[1]

您可能感兴趣的文章:

  • 统计在线人数是实时的吗?
  • 被动式统计网站在线人数
  • asp论坛在线人数统计研究
  • 也谈php网站在线人数统计
  • javascript 传统事件模型构造的事件监听器实现代码
  • c#显示当前在线人数示例
  • 封装了一个支持匿名函数的Javascript事件监听器
  • php+memcache实现的网站在线人数统计代码
  • PHP+jquery实时显示网站在线人数的方法
  • jsp利用application统计在线人数的方法
  • php实现统计网站在线人数的方法
  • ASP.NET中使用Application对象实现简单在线人数统计功能
  • php使用Session和文件统计在线人数
  • 浅析JAVA中过滤器、监听器、拦截器的区别
  • 利用java监听器实现在线人数统计

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 编程10000问 不用Global.asa也能实现统计在线人数吗? https://www.u-9.cn/biancheng/bc10000/96287.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务