HttpFileCollection.CopyTo Method (Array, Int32)

 

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

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

public void CopyTo(
	Array dest,
	int index
)

Parameters

dest
Type: System.Array

The destination Array.

index
Type: System.Int32

The index of the destination array where copying starts.

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

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

.NET Framework
Available since 1.1
Return to top
Show: