HttpCookieCollection.CopyTo(Array, Int32) メソッド

定義

配列の指定したインデックスから始まる Array に、Cookie コレクションのメンバーをコピーします。

public:
 void CopyTo(Array ^ dest, int index);
public void CopyTo(Array dest, int index);
member this.CopyTo : Array * int -> unit
Public Sub CopyTo (dest As Array, index As Integer)

パラメーター

dest
Array

コピー先 Array

index
Int32

コピーが開始されるコピー先配列のインデックス。

次の例では、Cookie コレクション全体を新しい Array オブジェクトにコピーします。

// 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 );
' 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)

適用対象

こちらもご覧ください