Udostępnij za pośrednictwem


FormsAuthenticationConfiguration.Domain Właściwość

Definicja

Pobiera lub ustawia nazwę domeny do wysłania przy użyciu plików cookie uwierzytelniania formularzy.

public:
 property System::String ^ Domain { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("domain", DefaultValue="")]
public string Domain { get; set; }
[<System.Configuration.ConfigurationProperty("domain", DefaultValue="")>]
member this.Domain : string with get, set
Public Property Domain As String

Wartość właściwości

Nazwa domeny dla plików cookie uwierzytelniania formularzy wychodzących. Wartość domyślna to pusty ciąg.

Atrybuty

Przykłady

Poniższy przykład kodu pokazuje, jak uzyskać dostęp do Domain właściwości. Zapoznaj się z przykładem kodu w temacie FormsAuthenticationConfiguration klasy, aby dowiedzieć się, jak uzyskać sekcję.

// Get the current Domain.
string currentDomain =
    formsAuthentication.Domain;

// Set the current Domain
formsAuthentication.Domain = "newDomain";
' Get the current Domain.
Dim currentDomain As String = formsAuthentication.Domain

' Set the current Domain
formsAuthentication.Domain = "newDomain"

Uwagi

Element Domain jest używany na potrzeby plików cookie uwierzytelniania.

Ta właściwość odpowiada wartości HttpCookie.Domain.

To ustawienie będzie mieć pierwszeństwo przed atrybutem domainforms sekcji dla plików cookie uwierzytelniania formularzy.

Dotyczy