HttpStaticObjectsCollection.CopyTo(Array, Int32) 方法

定义

HttpStaticObjectsCollection 的成员复制到数组。

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
Public Sub CopyTo (array As Array, index As Integer)

参数

array
Array

HttpStaticObjectsCollection 复制到其中的数组。

index
Int32

复制开始处的集合成员。

实现

示例

以下示例创建所需大小的新 Object 数组,并将现有 StaticObjects 集合复制到其中。

// Find the number of members in the StaticObjects collection.
int ObjCount = Application.StaticObjects.Count;
// Create an array of the same size.
Object[] MyObjArray = new Object[ObjCount];
// Copy the entire collection into the array.
Application.StaticObjects.CopyTo(MyObjArray, 0);
' Find the number of members in the StaticObjects collection.
Dim ObjCount As Integer = Application.StaticObjects.Count
' Create an array of the same size.
Dim MyObjArray(ObjCount) As Object
' Copy the entire collection into the array.
Application.StaticObjects.CopyTo(MyObjArray, 0)

适用于