HttpCookieCollection.Item Property (Int32)

 

Gets the cookie with the specified numerical index from the cookie collection.

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

public HttpCookie this[
	int index
] { get; }

Parameters

index
Type: System.Int32

The index of the cookie to retrieve from the collection.

Property Value

Type: System.Web.HttpCookie

The HttpCookie specified by index.

The following example stores the name of the first cookie as a string variable (index = 0) in a cookie collection.

String CookieName = MyCookieCollection[0].Name;

.NET Framework
Available since 1.1
Return to top
Show: