HttpRequest.IsSecureConnection Özellik

Tanım

HTTP bağlantısının güvenli yuvalar (HTTPS) kullanıp kullanmadığını belirten bir değer alır.

public:
 property bool IsSecureConnection { bool get(); };
public bool IsSecureConnection { get; }
member this.IsSecureConnection : bool
Public ReadOnly Property IsSecureConnection As Boolean

Özellik Değeri

Boolean

true bağlantı bir SSL bağlantısıysa; aksi takdirde , false.

Örnekler

Aşağıdaki kod örneği özelliğin false olarak ayarlanıp ayarlanmadığını IsSecureConnection belirler. Bu durumda, yanıtın SuppressContent gönderilmesini durdurmak için özelliği true olarak ayarlanır.

// Check whether the request is sent
// over HTTPS. If not, do not send 
// content to the client.    
if (!Request.IsSecureConnection)
{
    Response.SuppressContent = true;
}
' Check whether the request is sent
' over HTTPS. If not, do not return
' content to the client.
If (Request.IsSecureConnection = False) Then      
    Response.SuppressContent = True
End If

Şunlara uygulanır