Share via


HttpCookieCollection Klasse

Definition

Stellt einen Sammlungscontainer für Instanzen der HttpCookie-Klasse bereit.

public ref class HttpCookieCollection sealed : IIterable<HttpCookie ^>, IVectorView<HttpCookie ^>
/// [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 HttpCookieCollection final : IIterable<HttpCookie>, IVectorView<HttpCookie>
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class HttpCookieCollection final : IIterable<HttpCookie>, IVectorView<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>
Public NotInheritable Class HttpCookieCollection
Implements IEnumerable(Of HttpCookie), IReadOnlyList(Of HttpCookie)
Vererbung
Object Platform::Object IInspectable HttpCookieCollection
Attribute
Implementiert

Windows-Anforderungen

Gerätefamilie
Windows 10 (eingeführt in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (eingeführt in v1.0)

Hinweise

Die GetCookies-Methode für HttpCookieManager gibt ein HttpCookieCollection-Objekt zurück. Dies ist die Methode, die eine HttpCookieCollection erstellt wird.

Auflisten der Sammlung in C# oder Microsoft Visual Basic

HttpCookieCollection ist aufzählbar, sodass Sie sprachspezifische Syntax wie foreach in C# verwenden können, um die Elemente in der Auflistung aufzulisten. Der Compiler führt die Typumwandlung für Sie durch, und Sie müssen nicht explizit in IEnumerable<HttpCookie> umwandeln. Wenn Sie eine explizite Umwandlung durchführen müssen, z. B. wenn Sie GetEnumerator aufrufen möchten, wandeln Sie mit einer HttpCookie-Einschränkung in IEnumerable<T> um.

Eigenschaften

Size

Ruft die Anzahl der Cookies in httpCookieCollection ab.

Methoden

First()

Ruft einen Iterator für das erste HttpCookie-Element in der HttpCookieCollection ab.

GetAt(UInt32)

Gibt die HttpCookie am angegebenen Index aus der HttpCookieCollection zurück.

GetMany(UInt32, HttpCookie[])

Ruft die HttpCookie-Elemente ab, die am angegebenen Index in der HttpCookieCollection beginnen.

IndexOf(HttpCookie, UInt32)

Ruft den Index einer HttpCookie in der HttpCookieCollection ab.

Gilt für:

Weitere Informationen