%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% ' *** Visit Counter *** Dim FX_count, FX_digit, FX_dpath, FX_fpath FX_digit = 0 FX_dpath = Server.MapPath("FX_DataCounter") FX_fpath = Server.MapPath("FX_DataCounter/counter.txt") set FX_fso = Server.CreateObject("Scripting.FileSystemObject") ' Check if directory and file exists, if not create it. If (Not FX_fso.fileExists(FX_fpath)) Then If (Not FX_fso.folderExists(FX_dpath)) Then FX_fso.CreateFolder(FX_dpath) End If Application.Lock() set FX_file = FX_fso.OpenTextFile(FX_fpath, 8, true) FX_file.write(623) FX_file.Close() Application.Unlock() End If ' Read file and update it once per session set FX_fobj = FX_fso.getfile(FX_fpath) set FX_file = FX_fobj.OpenAsTextStream(1,-2) FX_count = FX_file.Read(100) If (Session("FX_DataCounter") = "") Then Application.Lock() set FX_file = FX_fso.CreateTextFile(FX_fpath, 8, false) FX_file.write(FX_count+1) FX_file.Close() Application.Unlock() set FX_fso = nothing FX_count = FX_count+1 Session("FX_DataCounter") = FX_count End If ' Add leadings FX_numlength = Len(cStr(FX_count)) If (FX_numlength < FX_digit) Then FX_lead = cInt(FX_digit - FX_numlength) For i=1 To FX_lead FX_count = "0" & FX_count Next End If %>
![]() |
||||
|
|
||||
|
||||
© 2006
All Rights Reserved, The
Community Foundation of South Alabama • P.O. Box 990, Mobile,
AL 36601 • 251.438.5591 • 251.438.5592 Fax |
||||