<%
Dim Visitors
WhichFile=Server.mappath("count.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
'启动count.txt文件，并且读取记录在文件中的visitors
If not fs.FileExists(WhichFile) then
   Set thisfile=fs.CreateTextFile(WhichFile)
   Visitors=0
Else   
   Set thisfile = fs.OpenTextFile(WhichFile)
   Visitors=thisfile.readline
End If   
thisfile.close
'防止刷新
If IsEmpty(Session("Connected")) Then
   '将计数器加1
   Visitors=Visitors+1
End If
Session("Connected")=True
'将计数器写入count.txt文件之中
Set out=fs.CreateTextFile(WhichFile)
out.WriteLine(Visitors) 
out.close
Set fs=nothing
%>

