HttpCookieCollection HttpCookieCollection HttpCookieCollection HttpCookieCollection Class

Provides a collection container for instances of the HttpCookie class.

Syntax

Declaration

public sealed class HttpCookieCollectionpublic sealed class HttpCookieCollectionPublic NotInheritable Class HttpCookieCollection

Remarks

The GetCookies(Windows.Foundation.Uri) 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 summary

Gets the number of cookies in the HttpCookieCollection.

Methods summary

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

Returns the HttpCookie at the specified index from the HttpCookieCollection.

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

Retrieves the index of an HttpCookie in the HttpCookieCollection.

Properties

  • Size
    Size
    Size
    Size

    Gets the number of cookies in the HttpCookieCollection.

    public uint Size { get; }public uint Size { get; }Public ReadOnly Property Size As uint

    Property Value

Methods

  • First()
    First()
    First()
    First()

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

    public IIterator<HttpCookie> First()public IIterator<HttpCookie> First()Public Function First() As IIterator( Of HttpCookie )

    Returns

  • GetAt(System.UInt32)
    GetAt(System.UInt32)
    GetAt(System.UInt32)
    GetAt(System.UInt32)

    Returns the HttpCookie at the specified index from the HttpCookieCollection.

    public HttpCookie GetAt(System.UInt32 index)public HttpCookie GetAt(System.UInt32 index)Public Function GetAt(index As System.UInt32) As HttpCookie

    Parameters

    • index
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

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

    Returns

  • GetMany(System.UInt32,Windows.Web.Http.HttpCookie[])
    GetMany(System.UInt32,Windows.Web.Http.HttpCookie[])
    GetMany(System.UInt32,Windows.Web.Http.HttpCookie[])
    GetMany(System.UInt32,Windows.Web.Http.HttpCookie[])

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

    public uint GetMany(System.UInt32 startIndex,Windows.Web.Http.HttpCookie[] items)public uint GetMany(System.UInt32 startIndex,Windows.Web.Http.HttpCookie[] items)Public Function GetMany(startIndex As System.UInt32,items As Windows.Web.Http.HttpCookie[]) As uint

    Parameters

    • startIndex
      System.UInt32
      System.UInt32
      System.UInt32
      System.UInt32

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

    • items
      Windows.Web.Http.HttpCookie[]
      Windows.Web.Http.HttpCookie[]
      Windows.Web.Http.HttpCookie[]
      Windows.Web.Http.HttpCookie[]

      The HttpCookie items that start at startIndex in the HttpCookieCollection.

    Returns

    • uint
      uint
      uint
      uint

      The number of HttpCookie items retrieved.

  • IndexOf(Windows.Web.Http.HttpCookie,System.UInt32)
    IndexOf(Windows.Web.Http.HttpCookie,System.UInt32)
    IndexOf(Windows.Web.Http.HttpCookie,System.UInt32)
    IndexOf(Windows.Web.Http.HttpCookie,System.UInt32)

    Retrieves the index of an HttpCookie in the HttpCookieCollection.

    public bool IndexOf(Windows.Web.Http.HttpCookie value,System.UInt32 index)public bool IndexOf(Windows.Web.Http.HttpCookie value,System.UInt32 index)Public Function IndexOf(value As Windows.Web.Http.HttpCookie,index As System.UInt32) As bool

    Parameters

    Returns

    • bool
      bool
      bool
      bool

      Indicates whether the item is found.

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

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Web.Http.dll