function | counter ' $U 2 Forum rautinee original $
' $http://u2bbs.126.com$
' The following function will implement any change in counter digits, and the preparation you want to do is:
' 1, 999_count.txt creates a text file and sets the initial value to 0.
' 2, prepare a set of digital pictures placed in the GIF directory
Function gcounter (Counterlen) ' Counterlen is the number of digits of the counter
Countfile=server.mappath ("999_count.txt")
Set fileobject=server.createobject ("Scripting.FileSystemObject")
Set Out=fileobject.opentextfile (Countfile,1,false,false)
Counter=out.readline ' read ' 999_count.txt inside the count value
Out.close
Set fileobject=server.createobject ("Scripting.FileSystemObject")
Set Out=fileobject.createtextfile (Countfile,true,false)
Application.Lock
Counter=counter+1 ' cumulative plus 1
Out.writeline (counter)
Application.UnLock
Out.close
Dim S, I, G, n
S = CStr (counter)
If Len (s) <counterlen then
For n = 1 to Counterlen-len (s)
G = g& "Next
End If
For i = 1 to Len (S)
g = g & "Next
Response.Write G
End Function