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;
A new StreamReader.
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. |
NGWS Runtime Security:
FileIOPermissionAccess | Read permission to the path. |
File Class | File Members | System.IO Namespace | File.OpenText Overload List