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)

適用対象