HttpResponseMessage.Dispose 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
释放由 HttpResponseMessage 使用的非托管资源,并可根据需要释放托管资源。
Dispose() |
释放由 HttpResponseMessage 使用的非托管资源。 |
Dispose(Boolean) |
释放由 HttpResponseMessage 使用的非托管资源,并可根据需要释放托管资源。 |
- Source:
- HttpResponseMessage.cs
- Source:
- HttpResponseMessage.cs
- Source:
- HttpResponseMessage.cs
释放由 HttpResponseMessage 使用的非托管资源。
public:
virtual void Dispose();
public void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit
Public Sub Dispose ()
实现
注解
释放正在进行的响应可以向服务器表明不再需要该响应。 此信号取决于实现或协议。
适用于
.NET 9 和其他版本
产品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
- Source:
- HttpResponseMessage.cs
- Source:
- HttpResponseMessage.cs
- Source:
- HttpResponseMessage.cs
释放由 HttpResponseMessage 使用的非托管资源,并可根据需要释放托管资源。
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
;如果仅释放非托管资源,则为 false
。
注解
释放正在进行的响应可以向服务器表明不再需要该响应。 此信号取决于实现或协议。
此方法由公共 Dispose()
方法和 Finalize() 方法调用(如果已重写)。
Dispose()
调用此方法,并将 disposing
参数设置为 true
。
Finalize
调用此方法,将 disposing
设置为 false
。
当 disposing
参数为 true
时,此方法释放该 HttpResponseMessage 引用的、由任何托管对象持有的全部资源。 此方法调用每个引用对象的 Dispose()
方法。
适用于
.NET 9 和其他版本
产品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |