StreamReader Constructor

Initializes a new instance of the StreamReader class for the specified file name.

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)

Syntax

public StreamReader (
         string path
)

Parameters

  • path
    The complete file path to be read.

Remarks

The complete file path is specified by the path parameter. The default character encoding and default buffer size are used.

The path parameter can be a file name, including a file on a Universal Naming Convention (UNC) share.

The path parameter is not required to be a file stored on disk; it can be any part of a system that supports access using streams.

Warning

When you compile a set of characters with a particular cultural setting and retrieve those same characters with a different cultural setting, the characters might not be interpretable, and could cause an exception to be thrown.

Version Information

Available in the .NET Micro Framework versions 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

StreamReader Class
StreamReader Members
System.IO Namespace