Export (0) Print
Expand All

Stream.Dispose Method ()

This method supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Releases all resources used by the Stream.

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

public void Dispose ()
public final void Dispose ()
public final function Dispose ()
Not applicable.

This method disposes the stream, by writing any changes to the backing store and closing the stream to release resources. 

Calling Dispose allows the resources used by the Stream to be reallocated for other purposes. For more information about Dispose, see Cleaning Up Unmanaged Resources.

Notes to Implementers: Place all cleanup logic for your stream object in Stream.Dispose(Boolean). Do not override Close.  Note that because of backward compatibility requirements, this method's implementation differs from the recommended guidance for the Dispose pattern.  This method calls Close, which then calls Stream.Dispose(Boolean).

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2014 Microsoft