FSO components of the CreateTextFile method introduced, interested in small partners can learn
Object. CreateTextFile (filename[, overwrite[, Unicode])
Parameter: Object
Required option. Should be the name of the FileSystemObject or Folder object.
FileName
Required option. A string expression that indicates the file to be created.
Overwrite
Options are available. A Boolean value that indicates whether the existing file can be overwritten. If the file can be overwritten, the value is true, otherwise false. If omitted, an existing file cannot be overwritten.
Unicode
Options are available. A Boolean value that indicates whether the file was created in Unicode or ASCII file mode. True if the file was created as a Unicode file, or False if created as an ASCII file. If omitted, it is assumed to be an ASCII file.
Description
The following code shows how to use the CreateTextFile method to create and open a text file.
var fso = new ActiveXObject ("Scripting.FileSystemObject"); var a = fso. CreateTextFile ("C:testfile.txt", true); A.writeline ("This is a test."); A.close ();
If the overwrite parameter is false, or if the parameter is not provided, then an error is generated for the existing filename.
"Recommended"
1. Share an ASP CreateTextFile definition and usage
2. asp FSO: Create a file CreateTextFile instance tutorial