Share via


FormsAuthenticationConfiguration.RequireSSL 屬性

定義

取得或設定值,指出在傳輸驗證資訊時是否需要 Secure Sockets Layer (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

屬性值

如果需要 SSL 連接則為 true,否則為 false。 預設為 false

屬性

範例

下列程式碼範例示範如何存取 RequireSSL 屬性 參考類別主題中的 FormsAuthenticationConfiguration 程式碼範例,以瞭解如何取得 區段。

// Create a new FormsAuthentication object.
FormsAuthenticationConfiguration newformsAuthentication =
new FormsAuthenticationConfiguration();
' Create a new FormsAuthentication object.
  Dim newformsAuthentication _
  As New FormsAuthenticationConfiguration()

備註

如果 RequireSSLtrue ,Web 應用程式會拒絕所有不使用 SSL 連線的表單驗證要求。

適用於

另請參閱