Editor Login | Register
Ekle

> Akademik İnternet ® > ASP
LogWriter (ing) - ASP - Akademik İnternet ® -
CWhite
(Relased 10.01.2008 21:41:33)


LogWriter (ing)
Log dosyasına sitenize ait kayıtları kayıtları kayıt yapan bir uygulama.
Kodu .asp uzantılı olarak kayıt yaptıktan sonra sayfalarınıza include ederek kullanabilirsiniz.
şeklinde kayıt yaparak include edebilirsiniz.Kayıt dosyanız
"c:\inetpub\wwwroot\logRecord.log" yolunda olacaktır

**************************************************************

      Const  ForAppending=8
      dim  LogRecords

        "You might change this line and
        "put logRecord.log  in  the folder you want.
      "LogRecords="c:\inetpub\wwwroot\logRecord.log"

      dim  x
      set  x=createObject("scripting.FileSystemObject")

      dim  y
      if  x.fileExists(LogRecords)  then
      set  y=x.openTextFile(LogRecords,ForAppending)
      else
      set  y=x.createTextFile(LogRecords)
      end  if

      sub  LogWrite(w)
      dim  u
      u=FormatDateTime(Now)
      u=u&w
      y.writeLine u
      end  sub

      sub  LogClose()
      y.close
      end  sub

      LogWrite"----"+request.serverVariables("remote_addr")
            + "----"+request.serverVariables("script_name")
      LogClose
      %>




Derecelendir
Kaynak CWhite Tarafından yazılmış/derlenmiştir.
İçerik İhbarı
Bağlantılar: bilgininefendisi.net

Open Source Document Project AUP&TOS