what is wrong with this?

Results 1 to 2 of 2

Thread: what is wrong with this?

  1. #1
    samikey Guest

    Default what is wrong with this?

    I cannot get this to work. What is wrong?<BR>&#060;% Set FileObject = Server.CreateObject("Scripting.FileSystemObject")< BR>Set HitsFile = Server.MapPath ("/counter") & "/hits.txt"<BR>Set InStream= FileObject.OpenTextFile <BR>(HitsFile, 1, false )OldHits = Trim(InStream.ReadLine)<BR>NewHits = OldHits + 1<BR>Set OutStream = FileObject.CreateTextFile (HitsFile, <BR>True)OutStream.WriteLine(NewHits)%&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default Sigh...guessing games, again...

    It would help *A LOT* if you told us WHAT ERROR MESSAGE you get and from what line.<BR><BR>But I&#039ll take a guess:<BR><BR>You still have the file open. You can *never* delete an open file, which is what you attempt to do when you do CreateTextFile and specify "write over the existing file".<BR><BR>Close the InStream before you try to create the OutStream.<BR><BR>

Posting Permissions

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