Results 1 to 4 of 4

Thread: Complete asp newby question.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Posts
    215
    I've never really touched asp before never really needed it, but I've just a couple of questions about it.

    first how can you open a text file for append in asp and add a line to it? and if the file does not exist it will be created?

    second how do you open a text in asp for just output and write a line to it? and again if the file does not exist will it be created?.

    thanx for any help.

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi Crypt

    you need to use the scripting object to do what you need.
    first create your file system object by using

    Set fs = CreateObject("Scripting.FileSystemObject")

    Then set up your file object by using this

    Set readfile=fs.OpenTextFile(filename,1,False)

    The last paramater is used for if you want a file created if it can't find one in the specified filename.

    then finally, use either readfile.readline to get a line of information or readfile.writeline to write a line. there is also other ones as well se here for more information

    http://msdn.microsoft.com/scripting/...threadline.htm

    Hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 2000
    Posts
    215
    thanx for the info, but one question about pws if someone can answer, I have it on my win98 cd but haven't installed it yet, but I heard you could test out asp with it so I think I will, but how do you test asp with it? just have it running and then open a webpage? or do you have to run the webpage from a certain path? or do you have to open it up in personal webserver or something?

    thanx again.

  4. #4
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    You have to put the ASP page in a directory that allows scripts to run.
    Then in your webbrowser you would type something like:
    http://localhost/mydir/myfile.asp
    or
    http://127.0.0.1/mydir/myfile.asp
    or
    http://myip/mydir/myfile.asp
    "People who think they know everything are a great annoyance to those of us who do."

Posting Permissions

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



Click Here to Expand Forum to Full Width