IPAddressCollection.CopyTo(IPAddress[], Int32) 方法

定义

将此集合中的元素复制到 IPAddress 类型的一维数组。Copies the elements in this collection to a one-dimensional array of type IPAddress.

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

参数

array
IPAddress[]

接收集合副本的一维数组。A one-dimensional array that receives a copy of the collection.

offset
Int32

array 中从零开始的索引,在此处开始复制。The zero-based index in array at which the copy begins.

实现

例外

arraynullarray is null.

offset 小于零。offset is less than zero.

array 是多维的。array is multidimensional.

- 或 --or-

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

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

注解

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

适用于