Freigeben über


HttpRequest.Form Eigenschaft

Definition

Ruft eine Auflistung von Formularvariablen ab.

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

Eigenschaftswert

Eine NameValueCollection Darstellung einer Auflistung von Formularvariablen.

Beispiele

Das folgende Beispiel zeigt, wie die Werte in der Formularauflistung gelesen werden, die aus einem Browser gepostet wurde. Jedes Name/Wert-Paar in der Auflistung stellt ein Steuerelement im Formular und dessen Wert dar.

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
   

Hinweise

Die Form Eigenschaft wird aufgefüllt, wenn der HTTP-Anforderungswert Content-Type entweder "application/x-www-form-urlencoded" oder "multipart/form-data" lautet.

Gilt für:

Weitere Informationen