NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

File.OpenText (String)

Creates a StreamReader that reads from an existing text file having the specified path.

[Visual Basic]
Overloads Public Shared Function OpenText( _
   ByVal path As String _
) As StreamReader
[C#]
public static StreamReader OpenText(
   string path
);
[C++]
public: static StreamReader* OpenText(
   String* path
);
[JScript]
public static function OpenText(
   path : String
) : StreamReader;

Parameters

path
The fully qualified path to the text file.

Return Value

A new StreamReader.

Exceptions

Exception Type Condition
ArgumentNullException path is a null reference (in Visual Basic Nothing).
SecurityException The caller does not have the required permission.
ArgumentException The file name is empty or contains only whitespaces.

Requirements

NGWS Runtime Security:

FileIOPermissionAccess Read permission to the path.

See Also

File Class | File Members | System.IO Namespace | File.OpenText Overload List