语言

ListBox.ObjectCollection.ICollection.CopyTo(Array, Int32) 方法

定义

从特定数组索引开始,将集合的元素复制到数组。

此 API 支持产品基础结构,不能在代码中直接使用。

 virtual void System.Collections.ICollection.CopyTo(Array ^ dest, int index) = System::Collections::ICollection::CopyTo;
 virtual void System.Collections.ICollection.CopyTo(Array ^ destination, int index) = System::Collections::ICollection::CopyTo;
void ICollection.CopyTo(Array dest, int index);
void ICollection.CopyTo(Array destination, int index);
abstract member System.Collections.ICollection.CopyTo : Array * int -> unit
override this.System.Collections.ICollection.CopyTo : Array * int -> unit
abstract member System.Collections.ICollection.CopyTo : Array * int -> unit
override this.System.Collections.ICollection.CopyTo : Array * int -> unit
Sub CopyTo (dest As Array, index As Integer) Implements ICollection.CopyTo
Sub CopyTo (destination As Array, index As Integer) Implements ICollection.CopyTo

参数

destdestination
Array

一维数组,它是从中 ICollection复制的元素的目标。 数组必须具有从零开始的索引。

index
Int32

数组中开始复制的从零开始的索引。

实现

例外

数组类型与 中的 ListBox.ObjectCollection项不兼容。

.NET 5 及更高版本: destination 是 null。

注解

此成员是显式接口成员实现。 仅当实例强制转换为ListBox.ObjectCollection接口时ICollection,才能使用它。

适用于