% u_file="counter.txt" set nib = createobject("scripting.filesystemobject") Set FS=Server.CreateObject("Scripting.FileSystemObject") if nib.FileExists (server.mappath(u_file)) then Set RS=FS.OpenTextFile(Server.MapPath(u_file), 1, False) count=RS.ReadLine RS.Close count=count+1 Set RS=FS.OpenTextFile(Server.MapPath(u_file), 2, False) RS.Write count RS.Close Set RS=Nothing Set FS=Nothing else set fs = CreateObject("Scripting.FileSystemObject") set file = fs.CreateTextFile(u_file, true, false) file.WriteLine("0") file.Close Response.Redirect(Request.ServerVariables ("URL")) end if %>
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||