OpenAsTextStream Method

Object: File
Syntax: OpenAsTextStream ([in] IOMode, [in] Format)
Returns: A TextStream object
Description:

This method opens a file and returns a TextStream object so you can read and write the contents of the file.

IOMode can be one of the following:

Constant Value Description
ForReading 1 To read the file. This is the default.
ForWriting 2 To write to the file.
ForAppending 8 To append to the file.

Format can be one of the following:

Constant Value Description
TristateTrue -1 Open the file as UNICODE.
TristateFalse 0 Open the file as ANSI. This is the default.
TristateUseDefault -2 Examine the file to determine if it should be opened as UNICODE or ANSI, and open the file appropriately.

These constants can be found using the IIS 4 or later TypeLibrary feature, or by viewing the vbFileManagerInclude.asp file contained in the .\Samples\directory.

Copyright © 2010 SoftArtisans, Inc. All rights reserved.