在线IP统计代码???

来源:百度知道 编辑:UC知道 时间:2024/05/13 09:06:52
????

一大早起来就帮你写了
首先,先准备一个空的 online.txt 文件,存在inc文件夹下
下面是代码部分
文件名: online.asp
文件内容:
<% '网站记数器
lgip=request.servervariables("remote_addr")
Set fs1 = CreateObject("Scripting.FileSystemObject")
CounterFile1 = Server.MapPath ("inc/online.txt")
On Error Resume Next
Set a1 = fs1.OpenTextFile(CounterFile1, 1, 0,False)
usercnt1 = a1.Readline
a2=split(usercnt1,"|")
For i = 0 to Ubound(a2)-1
a3=split(a2(i),"@")
if datevalue(now)-datevalue(a3(0))>0 or Timevalue(now)-Timevalue(a3(0))>0.005 then
b1=""
elseif a3(1)=lgip then
b1=now&"@"&lgip&"|"
else
b1=a2(i)&"|"
end if
b2=b2&b1
Next
if InStr(b2,lgip)=0 then
b2=b2&now&"@"&lgip&"|"
end if
a1.Close
Set a1=Nothing
set bb = fs1.CreateTextFile(CounterFile1)
bb.WriteLine