HttpCookiesSection.RequireSSL 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,指示是否需要安全套接字層(SSL)通訊。
此 API 支援此產品基礎結構,但無法直接用於程式碼之中。
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 屬性。
// Get the current RequireSSL.
Boolean requireSSLValue =
httpCookiesSection.RequireSSL;
// Set the RequireSSL.
httpCookiesSection.RequireSSL =
false;
' Get the current RequireSSL.
Dim requireSSLValue As Boolean = _
httpCookiesSection.RequireSSL
' Set the RequireSSL.
httpCookiesSection.RequireSSL = _
False
備註
此 RequireSSL 特性可啟用或停用安全 Cookie 屬性的輸出,詳見 RFC 2109。 當符合規範的瀏覽器使用時,cookie 只會透過使用 SSL/TLS 的連線回傳。 預設值為 false。