HttpCookieManager 类

定义

添加或删除 HttpCookie ,或查看与应用关联的 Cookie。

public ref class HttpCookieManager sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class HttpCookieManager final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class HttpCookieManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class HttpCookieManager
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class HttpCookieManager
Public NotInheritable Class HttpCookieManager
继承
Object Platform::Object IInspectable HttpCookieManager
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

HttpCookieManager 对象用于添加或删除 HttpCookie 或查看与应用关联的 Cookie。

HttpBaseProtocolFilter 上的 CookieManager 属性返回 HttpCookieManager 对象。 若要构造 HttpCookieManager,请先创建 HttpBaseProtocolFilter 对象,然后 HttpBaseProtocolFilter 上的 CookieManager 属性返回 HttpCookieManager 对象。

方法

DeleteCookie(HttpCookie)

从与应用关联的 Cookie 中删除 HttpCookie

GetCookies(Uri)

获取包含与特定 URI 关联的 HttpCookie 实例的 HttpCookieCollection

SetCookie(HttpCookie)

在与将来请求发送的应用关联的 Cookie 中添加或更改 HttpCookie

SetCookie(HttpCookie, Boolean)

在与应用关联的 Cookie 中添加或更改 HttpCookie

适用于

另请参阅