当前位置 > 文字教程 > asp教程

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

文章类别:asp | 发表日期:2008-10-5 20:54:07

<%
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
%>