HttpContent.Dispose 方法

定義

釋放 HttpContent 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。Releases the unmanaged resources used by the HttpContent and optionally disposes of the managed resources.

多載

Dispose()

釋放 Unmanaged 資源,並處置 HttpContent 所使用的 Managed 資源。Releases the unmanaged resources and disposes of the managed resources used by the HttpContent.

Dispose(Boolean)

釋放 HttpContent 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。Releases the unmanaged resources used by the HttpContent and optionally disposes of the managed resources.

Dispose()

釋放 Unmanaged 資源,並處置 HttpContent 所使用的 Managed 資源。Releases the unmanaged resources and disposes of the managed resources used by the HttpContent.

public:
 virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()

實作

Dispose(Boolean)

釋放 HttpContent 所使用的 Unmanaged 資源,並選擇性處置 Managed 資源。Releases the unmanaged resources used by the HttpContent and optionally disposes of the managed resources.

protected:
 virtual void Dispose(bool disposing);
protected virtual void Dispose (bool disposing);
abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit
Protected Overridable Sub Dispose (disposing As Boolean)

參數

disposing
Boolean

true 表示會同時釋放 Managed 和 Unmanaged 資源;false 則表示只釋放 Unmanaged 資源。true to release both managed and unmanaged resources; false to releases only unmanaged resources.

備註

這個方法是由公用Dispose()方法Finalize和方法所呼叫。This method is called by the public Dispose() method and the Finalize method. Dispose()Dispose(Boolean) 用受true保護的方法, 並將參數設定為。disposingDispose() invokes the protected Dispose(Boolean) method with the disposing parameter set to true. Finalize使用設定disposingfalse的叫用。 Dispose當參數為時true,這個方法會釋放此HttpContent參考之任何 managed 物件所持有的所有資源。 disposingFinalize invokes Dispose with disposing set to false.When the disposing parameter is true, this method releases all resources held by any managed objects that this HttpContent references. 這個方法會叫用每個參考物件的 Dispose() 方法。This method invokes the Dispose() method of each referenced object.

適用於