FormsAuthenticationConfiguration.RequireSSL 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,指示在傳輸認證資訊時是否需要安全套接字層(SSL)連線。
public:
property bool RequireSSL { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("requireSSL", DefaultValue=false)]
public bool RequireSSL { get; set; }
[<System.Configuration.ConfigurationProperty("requireSSL", DefaultValue=false)>]
member this.RequireSSL : bool with get, set
Public Property RequireSSL As Boolean
屬性值
true如果需要 SSL 連線;否則,。 false 預設值為 false。
- 屬性
範例
以下程式碼範例說明如何存取該 RequireSSL 屬性,請參考課程主題中的 FormsAuthenticationConfiguration 範例以學習如何取得該區段。
// Create a new FormsAuthentication object.
FormsAuthenticationConfiguration newformsAuthentication =
new FormsAuthenticationConfiguration();
' Create a new FormsAuthentication object.
Dim newformsAuthentication _
As New FormsAuthenticationConfiguration()
備註
若 RequireSSL 是 true,網頁應用程式會拒絕所有未使用 SSL 連線的表單認證請求。