![]()
<% 'Simple asp page counter by Barry Wright 'Using the File System Object 'Create the FSO Set bwoFSO = Server.CreateObject("Scripting.FileSystemObject") 'Location of text file to store page count. Set bwoFile = bwoFSO.OpenTextFile("count.txt") 'now we read the number in the file oldNum = CLng(bwoFile.ReadLine) 'and we close bwoFile.Close 'we add one to the number newNum = oldNum + 1 'we open the file to overwrite the new number to it Set bwoFile = bwoFSO.OpenTextFile("count.txt",2,true) 'and we overwrite it here bwoFile.WriteLine(newNum) 'and we close the file again bwoFile.Close 'now we use the number for our display strCount = newNum %> <% Response.Write(strCount) %> <% 'Write the pagecount Response.Write(strCount) %>