AuthenticationSection.Forms 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取 Forms 元素属性。
public:
property System::Web::Configuration::FormsAuthenticationConfiguration ^ Forms { System::Web::Configuration::FormsAuthenticationConfiguration ^ get(); };
[System.Configuration.ConfigurationProperty("forms")]
public System.Web.Configuration.FormsAuthenticationConfiguration Forms { get; }
[<System.Configuration.ConfigurationProperty("forms")>]
member this.Forms : System.Web.Configuration.FormsAuthenticationConfiguration
Public ReadOnly Property Forms As FormsAuthenticationConfiguration
属性值
包含在基于窗体的身份验证过程中所使用的信息的 Forms 元素属性。
- 属性
示例
下面的代码示例演示如何使用 Forms 元素属性。
// Get the current Forms property.
FormsAuthenticationConfiguration currentForms =
authenticationSection.Forms;
// Get the Forms attributes.
string name = currentForms.Name;
string login = currentForms.LoginUrl;
string path = currentForms.Path;
HttpCookieMode cookieLess = currentForms.Cookieless;
bool requireSSL = currentForms.RequireSSL;
bool slidingExpiration = currentForms.SlidingExpiration;
bool enableXappRedirect = currentForms.EnableCrossAppRedirects;
TimeSpan timeout = currentForms.Timeout;
FormsProtectionEnum protection = currentForms.Protection;
string defaultUrl = currentForms.DefaultUrl;
string domain = currentForms.Domain;
' Get the current Forms property.
Dim currentForms _
As FormsAuthenticationConfiguration = _
authenticationSection.Forms
' Get the Forms attributes.
Dim name As String = _
currentForms.Name
Dim login As String = _
currentForms.LoginUrl
Dim path As String = _
currentForms.Path
Dim cookieLess As HttpCookieMode = _
currentForms.Cookieless
Dim requireSSL As Boolean = _
currentForms.RequireSSL
Dim slidingExpiration As Boolean = _
currentForms.SlidingExpiration
Dim enableXappRedirect As Boolean = _
currentForms.EnableCrossAppRedirects
Dim timeout As TimeSpan = _
currentForms.Timeout
Dim protection As FormsProtectionEnum = _
currentForms.Protection
Dim defaultUrl As String = _
currentForms.DefaultUrl
Dim domain As String = _
currentForms.Domain