Creating a text file

Results 1 to 2 of 2

Thread: Creating a text file

  1. #1
    Join Date
    Dec 1969

    Default Creating a text file

    This works on PWS:<BR><BR>&#060;%<BR><BR>set newFileObject = Server.CreateObject"Scripting.FileSystemObject")<B R>set newFile = _<BR> newFileObject.CreateTextFile("C:myfiles\"&p_userna me)<BR>newFile.WriteLine("The user named after this file changed their password to "&p_pass1)<BR>newFile.Close<BR>set newFile = Nothing<BR>set newFileObject = Nothing<BR><BR>%&#062; <BR><BR>How do i get it to write the text file on a live server???

  2. #2
    Join Date
    Dec 1969

    Default You need...

    to set the physical path using the Server.MapPath method<BR><BR>E.G. using your code<BR><BR>RESPOND TO:<BR><BR> <BR>Creating a text file<BR> <BR>Bob - 12 Sep - 10:38:48 AM<BR>--------------------------------------------------------------------------------<BR>This works on PWS:<BR><BR>&#060;%<BR>Dim newFileObject, newFile, myPath<BR>myPath = Server.MapPath("C:myfiles\" & p_username)<BR><BR>&#039Make sure p_username has something valid in it.<BR><BR>set newFileObject = Server.CreateObject("Scripting.FileSystemObject")< BR>set newFile = _<BR>newFileObject.CreateTextFile(myPath)<BR>..<BR >..Code..<BR>..<BR>NewFile.Close<BR>set newFile = Nothing<BR>set newFileObject = Nothing<BR><BR>%&#062; <BR><BR> <BR> Hope thats correct and works.<BR>JohnC<BR><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