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.在需要计数的网页加入: 可以加在网页的任何你想要出现的地方
标签:客流量