|
<%
Function Counts(CounterFile)
Dim objFSO, objTS
Application.Lock
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(Server.MapPath(CounterFile), 1, True)
If Not objTS.AtEndOfStream Then '检查是否到达文件结尾
Counts = CLng(objTS.ReadLine)
End If
Counts = Counts + 1
objTS.Close
Set objTS = objFSO.OpenTextFile(Server.MapPath(CounterFile), 2, True)
objTS.WriteLine(Counts)
objTS.Close
Application.Unlock
End Function
Function G_Counts(CounterFile)
Dim objFSO, objTS, Counts, StrCounts
Application.Lock
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTS = objFSO.OpenTextFile(Server.MapPath(CounterFile), 1, True)
If Not objTS.AtEndOfStream Then '检查是否到达文件结尾
Counts = CLng(objTS.ReadLine)
End If
Counts = Counts + 1
objTS.Close
Set objTS = objFSO.OpenTextFile(Server.MapPath(CounterFile), 2, True)
objTS.WriteLine(Counts)
objTS.Close
Application.Unlock
StrCounts = CStr(Counts)
For i = 1 to Len(StrCounts)
G_Counts = G_Counts & "<IMG SRC=gif/" & Mid(StrCounts, i, 1) & ".gif>"
Next
End Function
%>
<%
If Session("Counter") = Empty Then
Session("Counter") = G_Counts("jishu.txt")
End If
%> |
|