|
<% ' http://www.globalDevelop.com ' Created by Oper
Dim objFSO, objCountFile Dim strCountFileName Dim iCount Dim bUseImages Dim I
dim counterfiletxt dim UpdateFlag Dim curDir
UpdateFlag="1" counterfiletxt="PageCounter.TXT" curDir = Server.MapPath(counterfiletxt) strcountfilename=curdir Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objCountFile = objFSO.OpenTextFile(strCountFileName, 1, True)
If Not objCountFile.AtEndOfStream Then ' Set value to contents of the file iCount = CLng(objCountFile.ReadLine) Else ' If no file exists or it's empty start at 0 iCount = 0 End If
objCountFile.Close Set objCountFile = Nothing if Updateflag="1" then iCount = iCount + 1 end if Set objCountFile = objFSO.CreateTextFile(strCountFileName, True) objCountFile.WriteLine iCount objcountFile.WriteLine "&CounterValue=" & icount objCountFile.Close Set objCountFile = Nothing %> |