共用方式為


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)

取得 HttpCookieCollection ,其中包含與特定 URI 相關聯的 HttpCookie 實例。

SetCookie(HttpCookie)

在與未來要求傳送的應用程式相關聯的 Cookie 中新增或變更 HttpCookie

SetCookie(HttpCookie, Boolean)

在與應用程式相關聯的 Cookie 中新增或變更 HttpCookie

適用於

另請參閱