共用方式為


FormsAuthenticationConfiguration.Domain 屬性

定義

取得或設定網域名稱,讓它能用表單認證 Cookie 傳送。

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

屬性值

發送表單的網域名稱,驗證 Cookies。 預設值為空字串。

屬性

範例

以下程式碼範例說明如何存取該 Domain 物業。 參考課堂主題中的 FormsAuthenticationConfiguration 程式碼範例,了解如何取得該章節。

// 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"

備註

這是 Domain 用於驗證 Cookie 的。

此性質對應於 的 HttpCookie.Domain值。

此設定將優先於 domain 表單認證 Cookie 區塊的 forms 屬性。

適用於