System.Net.Mail.AttachmentBase.Dispose Method

Releases the resources used by the System.Net.Mail.AttachmentBase.

Syntax

public void Dispose ()

Remarks

Call AttachmentBase.Dispose when you are finished using the System.Net.Mail.AttachmentBase. The AttachmentBase.Dispose method leaves the System.Net.Mail.AttachmentBase in an unusable state. After calling AttachmentBase.Dispose, you must release all references to the System.Net.Mail.AttachmentBase so the garbage collector can reclaim the memory that the System.Net.Mail.AttachmentBase was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

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

Requirements

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