HttpFileCollection.Item[] Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets an individual HttpPostedFile object from the file collection. This property is overloaded to allow retrieval of objects by either name or numerical index.
Overloads
Item[Int32] |
Gets the object with the specified numerical index from the HttpFileCollection. |
Item[String] |
Gets the object with the specified name from the file collection. |
Item[Int32]
Gets the object with the specified numerical index from the HttpFileCollection.
public:
property System::Web::HttpPostedFile ^ default[int] { System::Web::HttpPostedFile ^ get(int index); };
public System.Web.HttpPostedFile this[int index] { get; }
member this.Item(int) : System.Web.HttpPostedFile
Default Public ReadOnly Property Item(index As Integer) As HttpPostedFile
Parameters
- index
- Int32
The index of the item to get from the file collection.
Property Value
The HttpPostedFile specified by index
.
Examples
The following example retrieves the first file object (index = 0) from the collection sent by the client and retrieves the name of the actual file represented by the object.
HttpPostedFile MyPostedMember = Request.Files[0];
String MyFileName = MyPostedMember.FileName;
Dim MyPostedMember As HttpPostedFile = Request.Files(0)
Dim MyFileName As String = MyPostedMember.FileName
See also
Applies to
Item[String]
Gets the object with the specified name from the file collection.
public:
property System::Web::HttpPostedFile ^ default[System::String ^] { System::Web::HttpPostedFile ^ get(System::String ^ name); };
public System.Web.HttpPostedFile this[string name] { get; }
member this.Item(string) : System.Web.HttpPostedFile
Default Public ReadOnly Property Item(name As String) As HttpPostedFile
Parameters
- name
- String
Name of item to be returned.
Property Value
The HttpPostedFile specified by name
.
Examples
The following example retrieves the file object named "CustInfo" from the collection sent by the client and retrieves the name of the actual file represented by the object.
HttpPostedFile MyPostedMember = Request.Files["CustInfo"];
String MyFileName = MyPostedMember.FileName;
Dim MyPostedMember As HttpPostedFile = Request.Files("CustInfo")
Dim MyFileName As String = MyPostedMember.FileName
See also
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기