LINE 的计数器源程序(附源代码)

网络整理 - 09-11
<%
bUseImages = CBool(Request.QueryString("images"))
strCountFileName = Server.MapPath(Request.ServerVariables("script_NAME") & ".dat")
Set objFSO = Server.CreateObject("scripting.FileSystemObject")
' Open the file as a text stream (1 = ForReading, True = Create)
Set objCountFile = objFSO.OpenTextFile(strCountFileName, 1, True)
If Not objCountFile.AtEndOfStream Then
iCount = CLng(objCountFile.ReadAll)
Else
iCount = 0
End If
objCountFile.Close
Set objCountFile = Nothing
iCount = iCount + 1
Set objCountFile = objFSO.CreateTextFile(strCountFileName, True)
objCountFile.Write iCount
objCountFile.Close
Set objCountFile = Nothing
Set objFSO = Nothing
If bUseImages Then
For I = 1 to Len(iCount)
Response.Write "<IMG SRC=""./images/digit_"
Response.Write Mid(iCount, I, 1)
Response.Write ".gif"" ALT="""
Response.Write Mid(iCount, I, 1)
Response.Write """ width=20 height=27>"
Next
Else
Response.Write iCount
End If
%>