asp.net.ph

HttpFileCollection.CopyTo Method

System.Web Namespace   HttpFileCollection Class


Copies members of the file collection to an Array beginning at the specified index of the array.

[ VB ]
Public Sub CopyTo ( _
   ByVal dest As Array, _
   ByVal index As Integer _
)

[ C# ]
public void CopyTo (
   Array dest,
   int index
);

[ C++ ]
public: void CopyTo (
   Array* dest,
   int index
);

[ JScript ]
public function CopyTo (
   dest : Array,
   index : int
);

Parameters

dest
The destination Array.
index
The index of the destination array where copying starts.

Example

The following example copies the entire file collection into a new Array object.

[ VB ]
' 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 )

[ C# ]
// 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 );
See Also

HttpFileCollection Members   HttpPostedFile Class Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph