Click or drag to resize
StreamReader Class
Implements a TextReader that reads characters from a byte stream in a particular encoding.
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    System.IOTextReader
      System.IOStreamReader

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
[SerializableAttribute]
public class StreamReader : TextReader

The StreamReader type exposes the following members.

Methods
  NameDescription
Public methodDispose
Releases all resources used by the TextReader object.
(Inherited from TextReader.)
Protected methodDispose(Boolean)
Closes the underlying stream, releases the unmanaged resources used by the StreamReader, and optionally releases the managed resources.
(Overrides TextReaderDispose(Boolean).)
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodReadLine
Reads a line of characters from the current stream and returns the data as a string.
(Overrides TextReaderReadLine.)
Public methodReadToEnd
Reads the stream from the current position to the end of the stream.
(Overrides TextReaderReadToEnd.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberNull
A StreamReader object around an empty stream.
Top
Properties
  NameDescription
Public propertyEndOfStream
Gets a value that indicates whether the current stream position is at the end of the stream.
Top
See Also