home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / src / ASP / counter.asp < prev    next >
Encoding:
Text File  |  2001-10-03  |  1.2 KB  |  49 lines

  1. <%set FileObject = createobject("scripting.filesystemobject")
  2. totfile = server.mappath("counter.txt")
  3.  
  4. If FileObject.FileExists(totfile) Then
  5. set ActiveFile = FileObject.opentextfile(totfile)
  6. counter = clng(ActiveFile.readline)
  7. counter = counter + 1
  8. ActiveFile.close
  9. Set ActiveFile = FileObject.CreateTextFile(totfile, true)
  10. ActiveFile.WriteLine(counter)
  11. ActiveFile.Close         
  12.  
  13. Else
  14.  
  15. Set ActiveFile = FileObject.CreateTextFile(totfile)
  16. ActiveFile.WriteLine("1")
  17. counter=1
  18. ActiveFile.Close
  19.  
  20. End If
  21.  
  22. Response.Write "<b>" & counter & "</b> visits since 5 July 2000.<br>"
  23. td = FORMATDATETIME(DATE, vbShortDate)
  24. td = Replace(td, "/", "")
  25. td = td & ".txt"
  26. fpath = Server.Mappath(td)
  27.  
  28. If FileObject.FileExists(fpath) Then
  29. set ActiveFile = FileObject.opentextfile(fpath)
  30. counter = clng(ActiveFile.readline)
  31. counter = counter + 1
  32. ActiveFile.close
  33. Set ActiveFile = FileObject.CreateTextFile(fpath, true)
  34. ActiveFile.WriteLine(counter)
  35. ActiveFile.Close
  36.                      
  37. Else
  38.  
  39. Set ActiveFile = FileObject.CreateTextFile(fpath)
  40. ActiveFile.WriteLine("1")
  41. counter=1
  42. ActiveFile.Close
  43.                
  44. End If
  45.  
  46. Response.Write "<b>" & counter & "</b> visits today, " & Date & "<br>"
  47. %>
  48.  
  49.