% Dim objFSO, objCountFile ' object vars for FSO and File Dim strCountFileName ' filename of count text file Dim iCount ' count variable strCountFileName = Server.MapPath(Request.ServerVariables("SCRIPT_NAME") & ".cnt") 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 ' 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 iCount = iCount + 1 ' Overwrite existing file and get a text stream to new one Set objCountFile = objFSO.CreateTextFile(strCountFileName, True) objCountFile.Write iCount objCountFile.Close Set objCountFile = Nothing Set objFSO = Nothing %>
![]() |
|
|||
| HOME PAGE |
||||
Our Mission To foster the sustained development of school libraries and to
Back to the KwaZulu-Natal Department of Education website http://www.kzneducation.gov.za
TOP You are visitor: <% Response.Write iCount %>
|
||||