HttpFileCollection.GetKey(Int32) 方法

定义

返回具有指定数值索引的成员的名称 HttpFileCollection

public:
 System::String ^ GetKey(int index);
public string GetKey(int index);
member this.GetKey : int -> string
Public Function GetKey (index As Integer) As String

参数

index
Int32

要返回的对象名称的索引。

返回

HttpFileCollection. 指定的成员的名称index

示例

以下示例循环访问文件集合,并在找到名为“CustInfo”的文件集合成员时执行操作。

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

适用于