..


Sponsored Links

CreateTextFile

The CreateTextFile method creates a new text file in the current folder and returns a TextStream.
The method accepts three parameters in question:

  • filename - the name of the file to be created
  • overwrite - optional parameter; Boolean value that indicates whether an existing file can be overwritten or not. True indicates the file can be overwritten, False indicates that the file can not be overwritten. The default value is True;
  • unicode - optional parameter; Boolean value that indicates whether the file has been created as a Unicode or an ASCII file if it is. True indicates that the file created is Unicode, False indicates that the file was created as an ASCII file. The default is False;
Here's an example:





 dim fs, newfile









 'I create an instance of the FileSystemObject







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









 'I create a new text file







 September fs.CreateTextFile newfile = ("c: \ newfile.txt")









 'We write in







 newfile.WriteLine ("Hello World!")









 'Close







 newfile.close









 'I cleaned







 September newfile = 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