|
<%
'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("C:\wwwroot\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("C:\wwwroot\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
'function for image collecton
Function GetImage(strCount)
For numberID = 1 to Len(strCount)
'write the image code, location is bw0.gif - bw9.gif in root folder
Response.Write "<img src=""bw" & Mid(strCount,numberID,1) & ".gif"" width=""18"" height=""23"" border=""0"" alt=""" & Mid(strCount,numberID,1) & """>"
Next
End Function
%> |