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!

StreamReader Constructor (String, Encoding)

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
);

Parameters

path
The complete file path to be read.
encoding
The character encoding to use.

Exceptions

Exception Type Condition
ArgumentException path is an empty string ("").
ArgumentNullException path or encoding is null.
FileNotFoundException The file cannot be found.

Remarks

The default buffer size is used.

See Also

StreamReader Class | StreamReader Members | System.IO Namespace | StreamReader Constructor Overload List