Http​Cookie​Collection Http​Cookie​Collection Http​Cookie​Collection Class

Definition

Provides a collection container for instances of the HttpCookie class.

public : sealed class HttpCookieCollection : IIterable, IVectorViewpublic sealed class HttpCookieCollection : IEnumerable, IReadOnlyListPublic NotInheritable Class HttpCookieCollection Implements IEnumerable, IReadOnlyList
Attributes
Windows 10 requirements
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<T> with an HttpCookie constraint.

Properties

Item[Int32] Item[Int32] Item[Int32]

Gets the element at the specified index in the read-only list.

This member is not implemented in C++T this[int index] { get; }ReadOnly Property Item(index As Integer) As T
Parameters
index

The zero-based index of the element to get.

Value
T T T

The element at the specified index in the read-only list.

Attributes

Size Size Size

Gets the number of cookies in the HttpCookieCollection.

public : unsigned short Size { get; }This member is not implemented in C#This member is not implemented in VB.Net
Value
unsigned short uint uint

The number of cookies in the HttpCookieCollection.

Attributes

Methods

First() First() First()

Retrieves an iterator to the first HttpCookie item in the HttpCookieCollection.

public : IIterator<HttpCookie> First()This member is not implemented in C#This member is not implemented in VB.Net
Returns
Attributes
See Also

GetAt(UInt32) GetAt(UInt32) GetAt(UInt32)

Returns the HttpCookie at the specified index from the HttpCookieCollection.

public : HttpCookie GetAt(unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
index
unsigned int UInt32 UInt32

The zero-based index of a specified item in the HttpCookieCollection.

Returns

The HTTP cookie at the specified index from the HttpCookieCollection.

Attributes
See Also

GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the collection.

This member is not implemented in C++IEnumerator<T> GetEnumerator()Function GetEnumerator As IEnumerator(Of T)
Returns

An enumerator that can be used to iterate through the collection.

Attributes

GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[]) GetMany(UInt32, HttpCookie[])

Retrieves the HttpCookie items that start at the specified index in the HttpCookieCollection.

public : unsigned short GetMany(unsigned int startIndex, HttpCookie[] items)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
startIndex
unsigned int UInt32 UInt32

The zero-based index of the start of the HttpCookie items in the HttpCookieCollection.

items
HttpCookie[] HttpCookie[] HttpCookie[]

The HttpCookie items that start at startIndex in the HttpCookieCollection.

Returns
unsigned short uint uint

The number of HttpCookie items retrieved.

Attributes
See Also

IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32) IndexOf(HttpCookie, UInt32)

Retrieves the index of an HttpCookie in the HttpCookieCollection.

public : PlatForm::Boolean IndexOf(HttpCookie value, unsigned int index)This member is not implemented in C#This member is not implemented in VB.Net
Parameters
index
unsigned int UInt32 UInt32

The index of the HttpCookie in the HttpCookieCollection.

If the item is found, this is the zero-based index of the item; otherwise, this parameter is 0.

Returns
PlatForm::Boolean bool bool

Indicates whether the item is found.

true if the HttpCookie item is found; otherwise, false.

Attributes
See Also

See Also