FileWebResponse.IDisposable.Dispose 方法

定义

释放由 FileWebResponse 使用的所有资源。Releases all resources used by the FileWebResponse.

此 API 支持产品基础结构,不能在代码中直接使用。

 virtual void System.IDisposable.Dispose() = IDisposable::Dispose;
void IDisposable.Dispose ();
override this.System.IDisposable.Dispose : unit -> unit
Sub Dispose () Implements IDisposable.Dispose

实现

注解

使用完后,调用 Dispose () FileWebResponseCall Dispose() when you are finished using the FileWebResponse. Dispose () 方法会使 FileWebResponse 处于不可用状态。The Dispose() method leaves the FileWebResponse in an unusable state. () 调用 Dispose 后,必须释放对的所有引用, FileWebResponse 这样垃圾回收器才能收回占用的内存 FileWebResponseAfter calling Dispose(), you must release all references to the FileWebResponse so the garbage collector can reclaim the memory that the FileWebResponse was occupying. 有关详细信息,请参阅 清理非托管资源实现 Dispose 方法For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

备注

在释放对的最后一个引用之前,请始终调用 Dispose () FileWebResponseAlways call Dispose() before you release your last reference to the FileWebResponse. 否则,在垃圾回收器调用 FileWebResponse 对象的 Finalize 方法之前,该对象正在使用的资源不会被释放。Otherwise, the resources it is using will not be freed until the garbage collector calls the FileWebResponse object's Finalize method.

适用于