Creates a new instance of the StreamReader class on the specified path and with the specified character encoding.
[Visual Basic] Overloads Public Sub New( _ ByVal path As String, _ ByVal encoding As Encoding _ ) [C#] public StreamReader( string path, Encoding encoding ); [C++] public: StreamReader( String* path, Encoding* encoding ); [JScript] public function StreamReader( path : String, encoding : Encoding );
Exception Type | Condition |
---|---|
ArgumentException | path is an empty string (""). |
ArgumentNullException | path or encoding is null. |
FileNotFoundException | The file cannot be found. |
The default buffer size is used.
StreamReader Class | StreamReader Members | System.IO Namespace | StreamReader Constructor Overload List