HttpFileCollection.GetKey(Int32) Method

Definition

Returns the name of the HttpFileCollection member with the specified numerical index.

C#
public string GetKey(int index);

Parameters

index
Int32

The index of the object name to be returned.

Returns

The name of the HttpFileCollection member specified by index.

Examples

The following example loops through the file collection and takes action if a file collection member with the name "CustInfo" is found.

C#
int loop1;
 HttpFileCollection MyFileColl = Request.Files;

 for( loop1 = 0; loop1 < MyFileColl.Count; loop1++)
 {
    if( MyFileColl.GetKey(loop1) == "CustInfo")
    {
       //...
    }
 }

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1