HttpCookieCollection
HttpCookieCollection
HttpCookieCollection
HttpCookieCollection
HttpCookieCollection
Class
Definition
Provides a collection container for instances of the HttpCookie class.
public : sealed class HttpCookieCollection : IIterable<HttpCookie>, IVectorView<HttpCookie>
struct winrt::Windows::Web::Http::HttpCookieCollection : IIterable<HttpCookie>, IVectorView<HttpCookie>
public sealed class HttpCookieCollection : IEnumerable<HttpCookie>, IReadOnlyList<HttpCookie>
Public NotInheritable Class HttpCookieCollection Implements IEnumerable<HttpCookie>, IReadOnlyList<HttpCookie>
// This class does not provide a public constructor.
- Attributes
Device family |
Windows 10 (introduced v10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Remarks
The GetCookies method on HttpCookieManager returns an HttpCookieCollection object. This is the method that an HttpCookieCollection is constructed.
Enumerating the collection in C# or Microsoft Visual Basic
HttpCookieCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable<HttpCookie>
explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable
Properties
Item[Int32] Item[Int32] Item[Int32] Item[Int32] Item[Int32] |
Gets the element at the specified index in the read-only list. |
Size Size Size Size Size |
Gets the number of cookies in the HttpCookieCollection. |
Methods
First() First() First() First() First() |
Retrieves an iterator to the first HttpCookie item in the HttpCookieCollection. |
GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) GetAt(UInt32) |
Returns the HttpCookie at the specified index from the HttpCookieCollection. |
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator() |
Returns an enumerator that iterates through the collection. |
GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[]) |
Retrieves the HttpCookie items that start at the specified index in the HttpCookieCollection. |
IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32) |
Retrieves the index of an HttpCookie in the HttpCookieCollection. |