..


Sponsored Links

OpenTextFile

The OpenTextFile method of the FileSystemObject object opens a text file and returns a TextStream for access to the file.
The method in question accepts four parameters:

  • filename - the file path to open;
  • mode - (optional) determines how to open the file:
    • 1 = read only
    • 2 = write
    • 8 = append (writes at the end of the file)
  • created - (optional) is a boolean value. If set to True if the specified file will be created there is no other; If set to False, no, the default is False;
  • format - (optional) determines the format of the file paertura:
    • 0 = open file as ASCII;
    • -1 = Opens the file as Unicode;
    • -2 = Opens the file using the default mode;
For example:





 dim fs, f or







 'I create a FileSystemObject instance dell'offetto







 Set fs = Server.CreateObject ("Scripting.FileSystemObject")









 'I open the file







 Sept. for = fs.OpenTextFile ("c: \ www \ site \ page.html", 8, True)









 'I write a line at end of file







 fo.WriteLine ("Add this line at the end of the file ...")









 'Close







 fo.Close









 'I cleaned







 Sept. for = Nothing







 Set fs = Nothing



In the same category ...
E-Learning
ASP (Advanced) ASP (Advanced)
Full course for creating dynamic Web sites. From 39 €.
ASP Zero (Ebook) ASP Zero (Ebook)
Learning Microsoft ASP and VBScript from scratch. At only 29 €.
ASP and Access (Ebook) ASP and Access (Ebook)
Managing a MS Access database with ASP. At only 29 €.
Sponsored Links