How do I do a professional picture counter?
<%
Countlong=8
' defines the number of counter digits .
On Error Resume Next
' Ignore all the errors .
Count=server.mappath (Count.txt)
Set cou = Server.CreateObject (Scripting.FileSystemObject)
Set Out=cou.opentextfile (Count,1,false,false)
Counter=out.readline
Out.close
' Open the count.txt and read the value of the current counter .
If session (in) <>in then
' determine if the user has entered the home page and prevent users from refreshing or coming back to this page with a 1 counter added.
Session (in) =in
set out = Cou.createtextfile (Count,true,false)
Application.Lock
Counter=counter+1
' counter plus 1.
Out.writeline (counter)
Application.UnLock
Out.close
' Create a new file count.txt and write the value of the counter after adding 1 .
End If
CO=CSTR (counter)
' converts a numeric variable to a character type .
For i = 1 to Countlong-Len (CO)
' get The number of previous 0 pictures .
Response.Write
Next
' finish adding 0 pictures before the counter.
For i= 1 to Len (CO)
Response.Write
Next
' start reading from the first bit of the variable co .
%>
[1]