网页统计访客流量的代码

来源:百度知道 编辑:UC知道 时间:2024/05/09 14:16:19
急!我现在想往网站上放个能统计访客流量的代码,可是又不知道怎么写,有谁可以帮我找到那样的代码呀?
我指的是可以显示是第几位访客的那种代码

1.一个asp文件,一个计数的count.txt文件
asp文件
==========
<%
CountFile=Server.MapPath("count.txt")
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.OpenTextFile(CountFile,1,FALSE,FALSE)
counter=Out.ReadLine
Out.Close
SET FileObject=Server.CreateObject("Scripting.FileSystemObject")
Set Out=FileObject.CreateTextFile(CountFile,TRUE,FALSE)
Application.lock
counter= counter + 1
Out.WriteLine(counter)
Application.unlock
Response.Write"您是第"&counter&"位访客"
Out.Close
%>
==========
保存为count.asp,同目录下放一文本文件count.txt,初始数值为任意数字

2.在需要计数的网页加入:
<script language="JavaScript" src="count.asp"></script>

可以加在网页的任何你想要出现的地方

51la