HttpRequest.IsSecureConnection Tulajdonság

Definíció

Lekérdez egy értéket, amely jelzi, hogy a HTTP-kapcsolat biztonságos szoftvercsatornákat (azaz HTTPS-t) használ-e.

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

Tulajdonság értéke

trueha a kapcsolat SSL-kapcsolat; egyéb esetben. false

Példák

Az alábbi példakód azt határozza meg, hogy a IsSecureConnection tulajdonság értéke hamis-e. Ha igen, a SuppressContent tulajdonság igaz értékre van állítva, hogy megakadályozza a válasz küldését.

// 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

A következőre érvényes: