HttpCookie.Values Eigenschaft

Definition

Ruft eine Auflistung von Schlüssel-Wert-Paaren ab, die in einem einzelnen Cookie-Objekt enthalten sind.

public:
 property System::Collections::Specialized::NameValueCollection ^ Values { System::Collections::Specialized::NameValueCollection ^ get(); };
public System.Collections.Specialized.NameValueCollection Values { get; }
member this.Values : System.Collections.Specialized.NameValueCollection
Public ReadOnly Property Values As NameValueCollection

Eigenschaftswert

Eine Sammlung von Cookiewerten.

Beispiele

Im folgenden Codebeispiel wird ein neues Cookie erstellt und mehrere Werte hinzugefügt. Ein Beispiel zum Extrahieren mehrerer Werte aus einem Cookie finden Sie unter HasKeys.

HttpCookie MyCookie = new HttpCookie("Cookie1");
 MyCookie.Values["Val1"] = "1";
 MyCookie.Values["Val2"] = "2";
 MyCookie.Values["Val3"] = "3";
 Response.Cookies.Add(MyCookie);

Dim MyCookie As HttpCookie = New HttpCookie("Cookie1")
 MyCookie.Values("Val1") = "1"
 MyCookie.Values("Val2") = "2"
 MyCookie.Values("Val3") = "3"
 Response.Cookies.Add(MyCookie)
    

Gilt für:

Weitere Informationen