| <%
Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")
//this is the path to your counter1.txt file
counter = Server.MapPath("/asptests/aspc/counter.txt")
//open the text file
Set InStream = fso.OpenTextFile(counter)
oldCount = Trim(InStream.ReadLine)
//increment the oldcount by 1 and store in newcount
newCount = oldCount + 1
Set OutStream = fso.CreateTextFile(counter, True)
//copy newcount to the text file
OutStream.WriteLine(newCount)
%>
<%= newCount%> |