共用方式為


HttpCookiesSection.RequireSSL 屬性

定義

取得或設定值,指出 Secure Sockets Layer (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

屬性值

Boolean

如果啟用 SSL,則為 true,否則為 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

適用於

另請參閱