Freigeben über


HttpFileCollection.CopyTo-Methode

Kopiert Member der Dateiauflistung beginnend am angegebenen Index in ein Array.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

Syntax

'Declaration
Public Sub CopyTo ( _
    dest As Array, _
    index As Integer _
)
'Usage
Dim instance As HttpFileCollection
Dim dest As Array
Dim index As Integer

instance.CopyTo(dest, index)
public void CopyTo (
    Array dest,
    int index
)
public:
void CopyTo (
    Array^ dest, 
    int index
)
public void CopyTo (
    Array dest, 
    int index
)
public function CopyTo (
    dest : Array, 
    index : int
)

Parameter

  • index
    Der Index des Zielarrays, an dem mit dem Kopieren begonnen wird.

Beispiel

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.
 Dim MyArray As Array = Array.CreateInstance(GetType(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.
 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.
Array myArray = Array.CreateInstance(String.class.ToType(),
    get_Request().get_Files().get_Count());

// Copy the entire collection to the array.
get_Request().get_Files().CopyTo(myArray, 0);
// Create the one-dimensional target Array.
 // Dimension it large enough to hold the files collection.
 var myArray : System.Array = System.Array.CreateInstance(System.String, Request.Files.Count)
 
 // Copy the entire files collection to the array.
 Request.Files.CopyTo(myArray, 0)
    

Plattformen

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

HttpFileCollection-Klasse
HttpFileCollection-Member
System.Web-Namespace
Array