FormsAuthenticationConfiguration.Domain 属性

定义

获取或设置要与 Forms 身份验证 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

属性值

用于输出 Forms 身份验证 Cookie 的域的名称。 默认值为空字符串。

属性

示例

下面的代码示例演示如何访问 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 属性。

适用于