HttpFileCollection.GetKey(Int32) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Returnerar namnet på HttpFileCollection medlemmen med det angivna numeriska indexet.
public:
System::String ^ GetKey(int index);
public string GetKey(int index);
member this.GetKey : int -> string
Public Function GetKey (index As Integer) As String
Parametrar
- index
- Int32
Indexet för det objektnamn som ska returneras.
Returer
Namnet på medlemmen som HttpFileCollection anges av index.
Exempel
Följande exempel loopar igenom filsamlingen och vidtar åtgärder om en filsamlingsmedlem med namnet "CustInfo" hittas.
int loop1;
HttpFileCollection MyFileColl = Request.Files;
for( loop1 = 0; loop1 < MyFileColl.Count; loop1++)
{
if( MyFileColl.GetKey(loop1) == "CustInfo")
{
//...
}
}
Dim loop1 As Integer
Dim MyFileColl As HttpFileCollection = Request.Files
For loop1 = 0 To MyFileColl.Count - 1
If MyFileColl.GetKey(loop1) = "CustInfo" Then
'...
End If
Next loop1