![]() |
VOOZH | about |
The ASP CreateTextFile Method is used to create a new text file in the current folder or directory. It returns a TextStream object that can be used to perform operations on the file.
Syntax:
For Folder Object:
FolderObject.CreateTextFile(filename, overwrite, unicode)
For FileSystem Object:
FileSystemObject.CreateTextFile(filename, overwrite, unicode)
Parameters: This property has three parameters as mentioned above and described below:
The below examples demonstrate the ASP CreateTextFile Method.
Example 1: The below example demonstrates the ASP Folder.CreateTextFile Method.
Output:
A new textfile has been created! The File Contents are: Hello Geeks!
Example 2: The below example demonstrates the ASP FileSystemObject.CreateTextFile Method.
Output:
The new text file has been created! The File Contents are: Hello World!