1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

asp (visual basic script) write into a file

Discussion in 'C#' started by t7584, Mar 10, 2006.

  1. #1
    asp (visual basic script)
    1. how to write information into a file
    2. how to rewrite a file (remove contents of a file and write information into a file)?
    SEMrush
     
    t7584, Mar 10, 2006 IP
    SEMrush
  2. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you have to make sure that "IUSR_your machine" (your machine = name of your server) has change access to the file & directory, and you'd want to call the file system object.


    for example


    set FSO = server.createobject("Scripting.FileSystemObject")
    set filewriter = FSO.createtextfile("d:/yourdirectory/yourfile.html")
    filewriter.writeline "hello world"

    you can perform all sorts of file operations using the FSO, google filesystemobject for details, but that's the general idea of how its done in asp.

    VG
     
    vectorgraphx, Mar 10, 2006 IP
  3. edr

    edr Guest

    Messages:
    784
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you intend to run a process in the backend and not as an ASP page then replace Server.CreateObject with WScript.CreateObject and save as a .vbs file instead of .asp You can then run a scheduled job.
     
    edr, Mar 10, 2006 IP
  4. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    nice trick edr - i've actually got a backend job that i've been meaning to try to run as a sched. task - i'll give that a whirl :)

    VG
     
    vectorgraphx, Mar 10, 2006 IP
  5. frankcow

    frankcow Well-Known Member

    Messages:
    4,862
    Likes Received:
    264
    Best Answers:
    0
    Trophy Points:
    180
    #5
    frankcow, Mar 20, 2006 IP