System.Web Namespace HttpFileCollection Class
Returns the name of the HttpFileCollection member with the specified numerical index.
[ VB ]
Public Function GetKey ( _
ByVal index As Integer _
) As String
[ C# ]
public string GetKey (
int index
);
[ C++ ]
public: String* GetKey (
int index
);
[ JScript ]
public function GetKey (
index : int
) : String;
- index
- The index of the object name to be returned.
The name of the HttpFileCollection member specified by index.
The following example loops through the file collection and takes action if a file collection member with the name "CustInfo" is found.
[ VB ]
Dim i As Integer
Dim myFileColl As HttpFileCollection = Request.Files
For i = 0 To myFileColl.Count - 1
If myFileColl.GetKey ( i ) = "CustInfo" Then
' ... do whatever here ...
End If
Next i
[ C# ]
int i;
HttpFileCollection myFileColl = Request.Files;
for ( i = 0; i < myFileColl.Count; i++ ) {
if ( myFileColl.GetKey ( i ) == "CustInfo" ) {
// ... do whatever here ...
}
}
HttpFileCollection Members HttpPostedFile Class