BitArray.ICollection.CopyTo(Array, Int32) 方法

定义

从指定的 BitArray 索引位置开始,将 Array 的元素复制到 Array 中。Copies the elements of the BitArray to an Array, starting at the specified Array index.

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

参数

array
Array

一维 Array,它是从 BitArray 复制的元素的目标。The one-dimensional Array that is the destination of the elements copied from BitArray. Array 必须具有从零开始的索引。The Array must have zero-based indexing.

index
Int32

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

实现

例外

array 为 null。array is null.

index 小于零。index is less than zero.

array 具有多维性。- 或 - 源 BitArray 中的元素数量大于从 index 到目标 array 的可用空间。- 或 - 源 BitArray 的类型不能自动转换为目标 array 的类型。array is multidimensional.-or- The number of elements in the source BitArray is greater than the available space from index to the end of the destination array.-or-The type of the source BitArray cannot be cast automatically to the type of the destination array.

适用于