Results 1 to 2 of 2

Thread: Easy Question i think (Script Inside)

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    usa
    Posts
    10

    Question

    How can I get this script to save the file with the days date and time as the name. and help would be appreciated.
    Thanks

    Script:
    ==================================================
    <%
    Dim filesys, txtfile
    Set filesys = CreateObject("Scripting.FileSystemObject")
    Set txtfile = filesys.CreateTextFile("C:\test.txt", true)

    dim item
    for each item in Request.Form
    txtFile.WriteLine (Request.Form (item))
    next
    txtfile.close 'close the file
    set txtFile = nothing


    %>
    ===========================================================

  2. #2
    Guest
    Try this: (hopefully the Format function works in scripting)
    These won't be 8/3 filenames (obviously.)
    ==================================================
    <%
    Dim filesys, txtfile
    Set filesys = CreateObject("Scripting.FileSystemObject")
    Dim strFileName as string
    strFileName = Format(Now, "MMDDYYHHMM")
    strFileName = filesys.buildpath("C:\", strFileName & ".txt")
    Set txtfile = filesys.CreateTextFile(strFileName, true)

    dim item
    for each item in Request.Form
    txtFile.WriteLine (Request.Form (item))
    next
    txtfile.close 'close the file
    set txtFile = nothing


    %>
    ===========================================================

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