Building WebApps  «Prev  

Write to a File using ASP

Declare a Dim objFS0
  1. Declares variables needed to handle the file information. Assigns the name of the file to the strFileName variable
  2. Creates an instance of the File System Objects and assigns a reference to objFS0
  3. This statement verifies that the file exists. if it does not, a message should be displayed to the user
  4. Opens the text file in strFileName for reading, defined by the constant 1(2=write, 8 = append) Assigns a handle for the file to objLogFile
  5. While loop will continue executing until the End of File is encountered
  6. Reads a line from the text file and assigns it to current line . Information is read as a string.
  7. Appends a line break to the currentLine
  8. Message to be displayed if the file is not found.