ASP OpenAsTextStream Method
Complete File Object Reference
The OpenAsTextStream method opens a specified file and returns a TextStream object that can be used to access the file's contents.
Syntax
FileObject.OpenAsTextStream(mode,format)
| Parameter | Description |
|---|---|
| mode | Optional. How to open the file (input/output mode). * 1 = ForReading - Opens the file in read-only mode. You cannot write to this file. * 2 = ForWriting - Opens the file in read/write mode. If a file with the same name already exists, the old file is overwritten. * 8 = ForAppending - Opens the file and writes to the end of the file. |
| format | Optional. In what format to open the file. If omitted, the file is opened in ASCII format. * 0 = TristateFalse - Default. Opens the file in ASCII format. * -1 = TristateTrue - Opens the file in Unicode format. * -2 = TristateUseDefault - Opens the file using the system default format. |
Example
Output:
Hello World!
YouTip