Share via


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

要傳回的物件名稱索引。

傳回

String

index 指定的 HttpFileCollection 成員名稱。

範例

下列範例會迴圈查看檔案集合,並在找到名稱為 「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

適用於