<% Set oFs = CreateObject("Scripting.FileSystemObject") 'in case first visit and file doesn't exist on error resume next Set oFile= oFs.OpenTextFile(Server.MapPath("HitCount.txt"),1) 'No more errors should occur on error goto 0 if isObject(oFile) then lHitCount = oFile.ReadLine if isNumeric(lHitCount) then lHitCount = clng(lHitCount) else lHitCount = 0 end if oFile.Close else lHitCount = 0 end if 'This is the current hit count 'Write it out anywhere on the page 'Example is given below lHitCount = cstr(lHitCount + 1) 'Save New Count to File Set oFile= oFs.CreateTextFile(server.mappath("HitCount.txt"),True) oFile.writeLine cstr(lHitCount) oFile.close set oFs=nothing %>
Site hosted by Angelfire.com: Build your free website today!

Welcome to my page

You are visitor number <%=lHitCount %>.