英語で読む

次の方法で共有


HttpCookieCollection クラス

定義

HttpCookie クラスのインスタンスのコレクション コンテナーを提供します。

[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 HttpCookieCollection : IEnumerable<HttpCookie>, IReadOnlyList<HttpCookie>
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class HttpCookieCollection : IEnumerable<HttpCookie>, IReadOnlyList<HttpCookie>
継承
Object HttpCookieCollection
属性
実装

Windows の要件

デバイス ファミリ
Windows 10 (10.0.10240.0 で導入)
API contract
Windows.Foundation.UniversalApiContract (v1.0 で導入)

注釈

HttpCookieManagerGetCookies メソッドは、HttpCookieCollection オブジェクトを返します。 これは、HttpCookieCollection が構築されるメソッドです。

C# または Microsoft Visual Basic でのコレクションの列挙

HttpCookieCollection は列挙可能であるため、C# の foreach などの言語固有の構文を使用して、コレクション内の項目を列挙できます。 コンパイラによって型キャストが行われ、明示的に キャストする IEnumerable<HttpCookie> 必要はありません。 GetEnumerator を呼び出す場合など、明示的にキャストする必要がある場合は、HttpCookie 制約を使用して IEnumerable<T> にキャストします。

プロパティ

Size

HttpCookieCollection 内の Cookie の数を取得します。

メソッド

First()

HttpCookieCollection 内の最初の HttpCookie 項目を指す反復子を取得します。

GetAt(UInt32)

HttpCookieCollection から、指定したインデックス位置にある HttpCookie を返します

GetMany(UInt32, HttpCookie[])

HttpCookieCollection 内の指定したインデックスから始まる HttpCookie 項目を取得します。

IndexOf(HttpCookie, UInt32)

HttpCookieCollection 内の HttpCookie のインデックスを取得します。

適用対象

製品 バージョン
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

こちらもご覧ください