HttpRequest.Form HttpRequest.Form HttpRequest.Form HttpRequest.Form Property


Gets a collection of form variables.Gets a collection of form variables.

 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


フォーム変数のコレクションを表す NameValueCollectionA NameValueCollection representing a collection of form variables.

次の例では、ブラウザーからポストされたフォームのコレクション内の値を読み取る方法を示します。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.
// 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.

' 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


Formプロパティが設定されて、HTTP の要求とContent-Type値が"application/x-www-form-urlencoded"または「マルチパート/フォーム データ」です。The Form property is populated when the HTTP request Content-Type value is either "application/x-www-form-urlencoded" or "multipart/form-data".