asp.net.ph

HttpFileCollection.GetKey Method

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;

Parameters

index
The index of the object name to be returned.

Return Value

The name of the HttpFileCollection member specified by index.

Example

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 ...
   }
}
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