yokelrobin
08-30-2002, 09:50 AM
Can anyone see anything wrong with the following code:
<%@language=VBScript%>
<%on error resume next
fp = Server.MapPath("aspcount.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
if fs.FileExists(fp) then
Set a = fs.OpenTextFile(fp)
ct = Clng(a.ReadLine)
a.close
else
ct=0
end if
if Session("ct") = "" then
Session("ct") = ct
ct = ct + 1
Set a = fs.CreateTextFile(fp, True)
a.WriteLine(ct)
a.close
end if
'Response.Write ct
%>
The file aspcount.txt is online, and in the same directory.
It just doesn't seem to work every time.
Anything obvious?
Thanks :) yok
<%@language=VBScript%>
<%on error resume next
fp = Server.MapPath("aspcount.txt")
Set fs = CreateObject("Scripting.FileSystemObject")
if fs.FileExists(fp) then
Set a = fs.OpenTextFile(fp)
ct = Clng(a.ReadLine)
a.close
else
ct=0
end if
if Session("ct") = "" then
Session("ct") = ct
ct = ct + 1
Set a = fs.CreateTextFile(fp, True)
a.WriteLine(ct)
a.close
end if
'Response.Write ct
%>
The file aspcount.txt is online, and in the same directory.
It just doesn't seem to work every time.
Anything obvious?
Thanks :) yok