Sat Jul 14, 2012 1:16 am
<%
Const ReadConst=1
Const WriteConst=2
Dim OpenFileobj, MyFSO,MyFilePath,myCounter
MyFilePath=Server.MapPath("myCounter.txt")
Set MyFSO = Server.CreateObject("Scripting.FileSystemObject")
if MyFSO.fileExists(MyFilePath) Then
Set OpenFileobj = MyFSO.OpenTextFile(MyFilePath, ReadConst)
myCounter = OpenFileobj.ReadLine
Response.Write myCounter
OpenFileobj.Close
Set OpenFileobj = Nothing
Reading of files is over , now let us start writing new count value to file
Set OpenFileobj = MyFSO.OpenTextFile(MyFilePath, WriteConst)
myCounter=myCounter+1
OpenFileobj.Write(myCounter)
OpenFileobj.Close
Set OpenFileobj = Nothing
Else
Response.Write "File does not exist"
End if
Set MyFSO = Nothing
%>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.