HttpCookie Oluşturucular

Tanım

HttpCookie sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

Name Description
HttpCookie(String)

Yeni bir tanımlama bilgisi oluşturur ve adlandırmaktadır.

HttpCookie(String, String)

Yeni bir tanımlama bilgisine değer oluşturur, adlandırıp atar.

HttpCookie(String)

Yeni bir tanımlama bilgisi oluşturur ve adlandırmaktadır.

public:
 HttpCookie(System::String ^ name);
public HttpCookie(string name);
new System.Web.HttpCookie : string -> System.Web.HttpCookie
Public Sub New (name As String)

Parametreler

name
String

Yeni tanımlama bilgisinin adı.

Örnekler

Aşağıdaki kod örneği yeni bir tanımlama bilgisi oluşturur ve adlandırmaktadır.

HttpCookie MyCookie = new HttpCookie("LastVisit");

Dim MyCookie As New HttpCookie("LastVisit")
    

Şunlara uygulanır

HttpCookie(String, String)

Yeni bir tanımlama bilgisine değer oluşturur, adlandırıp atar.

public:
 HttpCookie(System::String ^ name, System::String ^ value);
public HttpCookie(string name, string value);
new System.Web.HttpCookie : string * string -> System.Web.HttpCookie
Public Sub New (name As String, value As String)

Parametreler

name
String

Yeni tanımlama bilgisinin adı.

value
String

Yeni tanımlama bilgisinin değeri.

Örnekler

Aşağıdaki kod örneği, yeni bir tanımlama bilgisinin değerini oluşturur, adlandırıp ayarlar.

HttpCookie MyCookie = new HttpCookie("LastVisit",
    DateTime.Now.ToString());

Dim MyCookie As New HttpCookie("LastVisit", CStr(DateTime.Now()))
    

Şunlara uygulanır