<%
Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
Set oFile = oFSO.OpenTextFile("C:\path\to\counter.txt")
oldNumber = CLng(oFile.ReadLine) 'read the current count out of the file
oFile.Close 'close the file because we're done reading it
oldNum = oldNum + 1 'add 1 to the current counter number
Set oFile = oFSO.OpenTextFile("C:\path\to\counter.txt",2,true)
oFile.WriteLine(oldNum) 'write the new counter value to file
oFile.Close 'close the file
Response.Write(oldNum & " visitors so far.")
%>
0 Comments:
Post a Comment
<< Home