HttpCookieCollection.CopyTo Method (Array, Int32)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Copies members of the cookie collection to an Array beginning at the specified index of the array.

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

Public Sub CopyTo (
	dest As Array,
	index As Integer
)

Parameters

dest
Type: System.Array

The destination Array.

index
Type: System.Int32

The index of the destination array where copying starts.

The following example copies the entire cookie collection into a new Array object.

' Create the one-dimensional target array.
 ' Dimension it large enough to hold the cookies collection.
 Dim MyArray As Array = Array.CreateInstance(GetType(String), Request.Cookies.Count)

 ' Copy the entire collection to the array.
 Request.Cookies.CopyTo(MyArray, 0)

.NET Framework
Available since 1.1
Return to top
Show: