<% dim visitors WhichFile=Server.mappath("count.txt") '创建一个FileSystemObject对象 Set fs = CreateObject("Scripting.FileSystemObject") '启动count.txt文件,并且读取记录在文件中的visitors Set thisfile = fs.OpenTextFile(WhichFile) Visitors=thisfile.readline thisfile.close '将计数器加1 Visitors=Visitors+1 '将计数器写如count.txt文件中 Set out=fs.CreateTextFile(WhichFile) out.WriteLine(Visitors) out.close Set fs=nothing %>
<%=visitors%>