System.IO.TextReader.Dispose Method

Releases all resources used by the System.IO.TextReader object.

Syntax

public void Dispose ()

Remarks

Call TextReader.Dispose when you are finished using the System.IO.TextReader. The TextReader.Dispose method leaves the System.IO.TextReader in an unusable state. After calling TextReader.Dispose, you must release all references to the System.IO.TextReader so the garbage collector can reclaim the memory that the System.IO.TextReader was occupying.

For more information, see [<topic://cpconCleaningUpUnmanagedResources>] and Implementing a Dispose Method.

Note:

Always call TextReader.Dispose before you release your last reference to the System.IO.TextReader. Otherwise, the resources it is using will not be freed until the garbage collector calls the System.IO.TextReader object's object.Finalize method.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0