Easy - or not? - textfile-writing

Results 1 to 2 of 2

Thread: Easy - or not? - textfile-writing

  1. #1
    Join Date
    Dec 1969

    Default Easy - or not? - textfile-writing

    Hi,<BR><BR>I&#039ve got a tiny little problem here. I&#039m going to build a function capable of writing a very advanced counter (including visitor&#039s IP, page they came from and where they&#039re heading). I want to write these &#039records&#039 to a text-file instead of a database (would become way to big very rapidly - 10000/day). Now; how can i append a counter-string to the existing-file, i&#039m sure that the answer is really easy, but i can&#039t get it to work, all it does is overwrite the existing string.<BR><BR>Keep in mind that the file is going to be massive in the end.

  2. #2
    Join Date
    Dec 1969

    Default RE: Easy - or not? - textfile-writing

    Path = Server.MapPath("Log.txt") &#039sökvägen till filen<BR><BR>Set FSO = CreateObject("Scripting.FileSystemObject")<BR>Set Filen = FSO.GetFile(path)<BR>Set TS = Filen.OpenAsTextStream(ForAppending, TristateUseDefault)<BR><BR>TS.WriteLine("Something into end of file.")<BR><BR>TS.Close<BR><BR>That should work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts