% ' Declare our vaiables Dim objFSO, objCountFile ' object vars for FSO and File Dim strCountFileName ' filename of count text file Dim iCount ' count variable Dim bUseImages ' boolean whether or not to use images Dim I ' standard looping var Dim strUpper ' for displaying 1'st, 2'nd, 3'rd, 4'th string Response.Expires = -1 Response.CacheControl = "no-cache" Response.ExpiresAbsolute = Now() - 1 ' Determine whether we use images or plain text ' You could just set this to True or False instead bUseImages = CBool(Request.QueryString("images")) ' Compute our count file's filename ' This is based on the file from which you call count.asp ' It basically takes that name and appends a .cnt so I don't ' accidently overwrite any files. If for some reason you have ' a file named script_name.asp.cnt then change this or watch out! strCountFileName = Server.MapPath("count.cnt") ' Create FileSystemObject to deal with file access Set objFSO = Server.CreateObject("Scripting.FileSystemObject") ' Open the file as a text stream (1 = ForReading, True = Create) if (objfso.FileExists(Server.MapPath("count.cnt"))) then Set objCountFile = objFSO.OpenTextFile(strCountFileName, 1, True) ' Read the current count from the file If Not objCountFile.AtEndOfStream Then ' Set value to contents of the file iCount = CLng(objCountFile.ReadAll) Else ' If no file exists or it's empty start at 0 iCount = 0 End If objCountFile.Close Set objCountFile = Nothing end if ' Destroy the FSO object Set objFSO = Nothing %>
|
||||||||||||||||||||||||||||||||||||
![]() |
||||||||||||||||||||||||||||||||||||
©
RNDSoftech Pvt Ltd, 2006-2007.
All rights reserved. Powered by RNDSoft. |
||||||||||||||||||||||||||||||||||||