%
'on error resume next 'to avoid any errors when opening a file that is not there
'err = 0 'this would only happen the first time though
dim objFS, fleHits 'optionally we could create the initial file by hand
Set objFS = CreateObject("Scripting.FileSystemObject")
Set fleHits = objFS.OpenTextFile(server.mappath("hitsfile.txt"),1)
if isObject(fleHits) then
currentHits = fleHits.ReadLine
if isNumeric(currentHits) then
currentHits = clng(currentHits)
else
currentHits = 0
end if
else
currentHits = 0
end if
fleHits.Close
'now we have the current hits
currentHits = cstr(currentHits + 1)
'we convert it to a string for processing later.
'save the new hit amount to file
Set fleHits = objFS.CreateTextFile(server.mappath("hitsfile.txt"),True)
fleHits.writeLine cstr(currentHits)
fleHits.close
set objFs=nothing
'Now output to the screen
'
'we have a gif library of our standard images 0-9 avilable in our common gifs directory
for x = 1 to len(currentHits)
' response.write ""
next
'response.write "
"
'
'
'alternatively we could just print out the results:
response.write currentHits
%>