HttpStaticObjectsCollection.CopyTo(Array, Int32) Método

Definição

Copia os membros de uma HttpStaticObjectsCollection para uma matriz.

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)

Parâmetros

array
Array

A matriz para a qual copiar a HttpStaticObjectsCollection.

index
Int32

O membro da coleção em que a cópia inicia.

Implementações

Exemplos

O exemplo a seguir cria uma nova Object matriz do tamanho necessário e copia uma coleção existente StaticObjects nela.

// 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)

Aplica-se a