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
);
- dest
- The destination Array.
- index
- The index of the destination array where copying starts.
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 );
HttpFileCollection Members HttpPostedFile Class