<%
arquivo=""
'bote o nome do arquivo de texto entre as aspas
set nib = createobject("scripting.filesystemobject")
Set FS=Server.CreateObject("Scripting.FileSystemObject")
if nib.FileExists (server.mappath(arquivo)) then
Set RS=FS.OpenTextFile(Server.MapPath(arquivo), 1, False)
count=RS.ReadLine
RS.Close
count=count+1
Set RS=FS.OpenTextFile(Server.MapPath(arquivo), 2, False)
RS.Write count
RS.Close
Set RS=Nothing
Set FS=Nothing
else
set fs = CreateObject("Scripting.FileSystemObject")
set file = fs.CreateTextFile(arquivo, true, false)
file.WriteLine("0")
file.Close
Response.Redirect(Request.ServerVariables ("URL"))
end if
%><%=count%>