HttpFileCollection.GetKey(Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳成員名稱 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