Mono Class Library: System.IO.StreamReader Overview | MembersSystem.IO.StreamReader Constructor |
Constructs and initializes a new instance of the System.IO.StreamReader class for the specified file name and with the specified character encoding. [Edit]
|
- path
- A string that specifies the complete file path to read. [Edit]
- encoding
- A System.Text.Encoding that specifies the character encoding to use. [Edit]
Type Reason System.IO.IOException path is in an invalid format or contains invalid characters. [Edit] System.IO.DirectoryNotFoundException The directory information specified in path was not found. [Edit] System.IO.FileNotFoundException The file specified in path was not found. [Edit] ArgumentException path is an empty string (""). [Edit] ArgumentNullException path or encoding is null . [Edit]
This constructor initializes the StreamReader.CurrentEncoding property using encoding , and the internal buffer to the default size.
Note: The default buffer size is implementation defined.Note:[Edit]path is not required to be a file stored on disk; it can be any part of a system that supports access via streams. For example, depending on the system, this class might be able to access a physical device.
For information on the valid format and characters for path strings, see System.IO.Path.
Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0