CookieCollection.CopyTo 方法

定义

将该 CookieCollection 的元素复制到指定的数组。Copies the elements of this CookieCollection to the specified destination array.

重载

CopyTo(Array, Int32)

CookieCollection 的元素复制到指定数组,从特定索引开始。Copies the elements of a CookieCollection to the specified array, starting at a particular index.

CopyTo(Cookie[], Int32)

将该 CookieCollection 的元素复制到在目标数组的指定索引处开始的 Cookie 数组。Copies the elements of this CookieCollection to a Cookie array starting at the specified index of the target array.

CopyTo(Array, Int32)

CookieCollection 的元素复制到指定数组,从特定索引开始。Copies the elements of a CookieCollection to the specified array, starting at a particular index.

public:
 virtual void CopyTo(Array ^ array, int index);
public void CopyTo (Array array, int index);
abstract member CopyTo : Array * int -> unit
override this.CopyTo : Array * int -> unit

参数

array
Array

CookieCollection 将被复制到的目标数组。The target array to which the CookieCollection will be copied.

index
Int32

目标数组中复制开始位置的从零开始的索引。The zero-based index in the target array where copying begins.

实现

异常

arraynullarray is null.

index 小于零。index is less than zero.

array 是多维的。array is multidimensional.

- 或 --or- CookieCollection 中的元素数大于从 index 到目标 array 末尾之间的可用空间。The number of elements in this CookieCollection is greater than the available space from index to the end of the destination array.

CookieCollection 中的元素无法自动转换为目标 array 的类型。The elements in this CookieCollection cannot be cast automatically to the type of the destination array.

注解

Arrayarray参数必须是一维,并具有从零开始的索引。The Arrayarray parameter must be one-dimensional with zero-based indexing.

将该 CookieCollection 的元素复制到在目标数组的指定索引处开始的 Cookie 数组。Copies the elements of this CookieCollection to a Cookie array starting at the specified index of the target array.

public:
 virtual void CopyTo(cli::array <System::Net::Cookie ^> ^ array, int index);
public void CopyTo (System.Net.Cookie[] array, int index);
abstract member CopyTo : System.Net.Cookie[] * int -> unit
override this.CopyTo : System.Net.Cookie[] * int -> unit
Public Sub CopyTo (array As Cookie(), index As Integer)

参数

array
Cookie[]

Cookie 将被复制到的目标 CookieCollection 数组。The target Cookie array to which the CookieCollection will be copied.

index
Int32

目标数组中复制开始位置的从零开始的索引。The zero-based index in the target array where copying begins.

异常

arraynullarray is null.

index 小于零。index is less than zero.

array 是多维的。array is multidimensional.

- 或 --or- CookieCollection 中的元素数大于从 index 到目标 array 末尾之间的可用空间。The number of elements in this CookieCollection is greater than the available space from index to the end of the destination array.

CookieCollection 中的元素无法自动转换为目标 array 的类型。The elements in this CookieCollection cannot be cast automatically to the type of the destination array.

注解

array参数必须是一维,并具有从零开始的索引。The array parameter must be one-dimensional with zero-based indexing.

适用于