asp.net.ph

HttpCookieCollection.CopyTo Method

System.Web Namespace   HttpCookieCollection Class


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

[ VB ]
Public Sub CopyTo ( _
   ByVal dest As Array, _
   ByVal index As Integer _
)

[ C# ]
public void CopyTo (
   Array dest,
   int index
);

[ C++ ]
public: void CopyTo (
   Array* dest,
   int index
);

[ JScript ]
public function CopyTo (
   dest : Array,
   index : int
);

Parameters

dest
The destination Array.
index
The index of the destination array where copying starts.

Example

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

[ VB ]
' 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 )

[ C# ]
// Create the one-dimensional target array.
 // Dimension it large enough to hold the cookies collection.
 Array myArray = Array.CreateInstance ( typeof ( String ) , Request.Cookies.Count  );

 // Copy the entire collection to the array.
 Request.Cookies.CopyTo ( myArray, 0  );
See Also

HttpCookieCollection Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph