|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。fso|统计|在线|在耳目数
count.asp:
<%Server.ScriptTimeout=300
id=Trim(Request.QueryString("id"))
fc=Trim(Request.QueryString("fc"))
iffc=""thenfc="FFFF00"
bg=Trim(Request.QueryString("bg"))
ifbg=""thenbg="000000"
bc=Trim(Request.QueryString("bc"))
ifbc=""thenbc="00FF00"
sername=Request.ServerVariables("SERVER_NAME")
scrname=Request.ServerVariables("SCRIPT_NAME")
linkurl="http://"&sername&scrname
%>
<html>
<head>
<title>及时统计在耳目数</title>
<METAHTTP-EQUIV="Refresh"content="10;URL=<%=linkurl%>">每隔10秒革新
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<styleTYPE="text/CSS">
<!--
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}
-->
</style>
</head>
<%
countfile=server.mappath("people.asp")
Setfs=CreateObject("Scripting.FileSystemObject")
n=Year(date())
y=Month(date())
r=Day(date())
s=Hour(time())
f=Minute(time())
m=Second(time())
iflen(y)=1theny="0"&y
iflen(r)=1thenr="0"&r
iflen(s)=1thens="0"&s
iflen(f)=1thenf="0"&f
iflen(m)=1thenm="0"&m
sj=n&"-"&y&"-"&r&""&s&":"&f&":"&m
格局化日期、工夫
dimly()
Setthisfile=fs.OpenTextFile(countfile,1,False)
countly=0
dowhilenotthisfile.AtEndOfStream
thisline=thisfile.readline
Redimpreservely(countly)
ly(countly)=thisline
countly=countly+1
loop将people.asp中内容读到数组中
thisfile.close
sameip=0
fori=1to(countly-1)/2
ifDateDiff("s",ly(i*2),sj)>60then
ly(i*2-1)=""
ly(i*2)=""
countly=countly-2
endif
ifRequest.ServerVariables("REMOTE_ADDR")=ly(i*2-1)then
sameip=1IP已存在
ly(i*2)=sj
endif
next
setoutfile=fs.CreateTextFile(countfile)
fori=0tocountly-1
ifly(i)""then
outfile.WriteLinely(i)
endif
next
ifsameip=0then
outfile.WriteLineRequest.ServerVariables("REMOTE_ADDR")
outfile.WriteLinesj 增加新纪录
outfile.Close
endif
Setthisfile=fs.OpenTextFile(countfile,1,False)
countly=0
dowhilenotthisfile.AtEndOfStream
thisline=thisfile.readline
Redimpreservely(countly)
ly(countly)=thisline
countly=countly+1总的纪录行数
loop
thisfile.close
total=(countly-1)/2统计总人数,每人有两行纪录:IP、工夫
%>
<body>
<p><selectname="Online"size="1">
<optionselectedvalue="Online"><%=total%>人在线上</option>
<%
fori=1tototal
response.write"<option>"&ly(i*2-1)&"</option>"
next
%>
</select></p>
</body>
</html>
people.asp:
<%Response.end%>
172.16.20.230用户IP
2003-06-1509:53:57登录工夫
缺乏可以共同遵循的行业标准,ASP还处在发展初期,大家对它的理解不同,如产品和服务标准,收费标准等,不利于行业的健康发展。 |
|