HttpFileCollection.CopyTo(Array, Int32) Methode

Definition

Kopiert Elemente der Dateisammlung an einen Array Anfang am angegebenen Index des Arrays.

public:
 void CopyTo(Array ^ dest, int index);
public void CopyTo(Array dest, int index);
member this.CopyTo : Array * int -> unit
Public Sub CopyTo (dest As Array, index As Integer)

Parameter

dest
Array

Der Ziel-Array.

index
Int32

Der Index des Zielarrays, in dem das Kopieren beginnt.

Beispiele

Im folgenden Beispiel wird die gesamte Dateiauflistung in ein neues Array Objekt kopiert.

// Create the one-dimensional target array.
 // Dimension it large enough to hold the files collection.
 Array MyArray = Array.CreateInstance( typeof(String), Request.Files.Count );

 // Copy the entire collection to the array.
 Request.Files.CopyTo( MyArray, 0 );
' Create the one-dimensional target array.
 ' Dimension it large enough to hold the files collection.
 Dim MyArray As Array = Array.CreateInstance(GetType(String), Request.Files.Count)
 
 ' Copy the entire collection to the array.
 Request.Files.CopyTo(MyArray, 0)

Gilt für:

Weitere Informationen