<%
Function Counts(CounterFile)
Dim objFSO, objTS
Application.Lock
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"
Set objTS = objFSO.OpenTextFile(Server.MapPath(CounterFile), 1, True)
If Not objTS.AtEndOfStream Then '检查是否到达文件结尾
Counts = CLng(objTS.ReadLine)
End If
Counts = Counts + 1
objTS.Close
Set objTS = objFSO.OpenTextFile(Server.MapPath(CounterFile), 2, True)
objTS.WriteLine(Counts)
objTS.Close
Application.Unlock
End Function
If Session("Counter"
= Empty Then
Session("Counter"
= Counts("jishu.txt"
End If
%>
网上找了个计数器代码,我觉得很简单很实用。不过现在是每个IP在一定的时间内只算一次访问,我想改成刷新一下就加1的那种简单的,呵呵,请问如何修改?
当然,这个按IP统计的能保留最好,到时候就知道了访问量和点击量。不过要把访问量隐藏起来~