HttpRequest.Form 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 a collection of form variables.
public:
property System::Collections::Specialized::NameValueCollection ^ Form { System::Collections::Specialized::NameValueCollection ^ get(); };
public System.Collections.Specialized.NameValueCollection Form { get; }
member this.Form : System.Collections.Specialized.NameValueCollection
Public ReadOnly Property Form As NameValueCollection
Property Value
A NameValueCollection representing a collection of form variables.
Examples
The following example shows how to read the values in the form collection posted from a browser. Each name/value pair in the collection represents a control in the form and its value.
int loop1;
NameValueCollection coll;
//Load Form variables into NameValueCollection variable.
coll=Request.Form;
// Get names of all forms into a string array.
String[] arr1 = coll.AllKeys;
for (loop1 = 0; loop1 < arr1.Length; loop1++)
{
Response.Write("Form: " + arr1[loop1] + "<br>");
}
Dim loop1 As Integer
Dim arr1() As String
Dim coll As NameValueCollection
' Load Form variables into NameValueCollection variable.
coll=Request.Form
' Get names of all forms into a string array.
arr1 = coll.AllKeys
For loop1 = 0 To arr1.GetUpperBound(0)
Response.Write("Form: " & arr1(loop1) & "<br>")
Next loop1
Remarks
The Form property is populated when the HTTP request Content-Type
value is either "application/x-www-form-urlencoded" or "multipart/form-data".
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기