所属类别:ASP编程
特别推荐:免费发布信息 承包关键词~~抢爆了!HOT!
count.asp:<%Server.ScriptTimeout=300id=Trim(Request.QueryString("id"))fc=Trim(Request.QueryString("fc"))if fc="" then fc="FFFF00"bg=Trim(Request.QueryString("bg"))if bg="" then bg="000000"bc=Trim(Request.QueryString("bc"))if bc="" then bc="00FF00"sername=Request.ServerVariables("SERVER_NAME")scrname=Request.ServerVariables("SCRIPT_NAME")linkurl="http://" & sername & scrname%>实时统计在线人数"> '每隔10秒刷新<!--P {FONT-SIZE: 9pt; font-color: #eeeeee}A {TEXT-DECORATION: none}A:link {COLOR: #0068A3}A:visited {COLOR: #0068A3}A:hover {COLOR: #2f00ff; TEXT-DECORATION: underline}.ourfont {font-size: 9pt }BODY { FONT-SIZE: 9pt}TABLE { FONT-SIZE: 9pt}--><%countfile=server.mappath("people.asp")Set fs=CreateObject("Scripting.FileSystemObject")n=Year(date())y=Month(date())r=Day(date())s=Hour(time())f=Minute(time())m=Second(time())if len(y)=1 then y="0" & yif len(r)=1 then r="0" & rif len(s)=1 then s="0" & sif len(f)=1 then f="0" & fif len(m)=1 then m="0" & msj = n & "-" & y & "-" & r & " " & s & ":" & f & ":" & m '格式化日期、时间dim ly()Set thisfile=fs.OpenTextFile(countfile,1,False)countly=0do while not thisfile.AtEndOfStreamthisline = thisfile.readlineRedim preserve ly(countly)ly(countly) = thislinecountly = countly + 1loop '将people.asp中内容读到数组中thisfile.closesameip=0for i=1 to (countly-1)/2if DateDiff("s",ly(i*2),sj)>60 thenly(i*2-1)=""ly(i*2)=""countly=countly-2end ifif Request.ServerVariables("REMOTE_ADDR")=ly(i*2-1) thensameip=1 'IP已经存在ly(i*2)=sjend ifnextset outfile=fs.CreateTextFile(countfile)for i=0 to countly-1if ly(i)<>"" thenoutfile.WriteLine ly(i)end ifnextif sameip=0 thenoutfile.WriteLine Request.ServerVariables("REMOTE_ADDR")outfile.WriteLine sj
'添加新记录outfile.Closeend ifSet thisfile=fs.OpenTextFile(countfile,1,False)countly=0do while not thisfile.AtEndOfStreamthisline = thisfile.readlineRedim preserve ly(countly)ly(countly) = thislinecountly = countly + 1'总的记录行数loopthisfile.closetotal=(countly-1)/2 '统计总人数,每人有两行记录:IP、时间%> <%=total%>人在线上<%for i=1 to totalresponse.write ""&ly(i*2-1)&""next%>people.asp:<%Response.end%>172.16.20.230'用户IP2003-06-15 09:53:57'登录时间
相关信息· Web设计里的软件工程思想
· 三星的速度经营
· FullerScreen-Firefox 全屏显示扩展
· 基于局域网络应用Java语言实现远程智能终端的控制
84963
80483
