HttpRequest.IsSecureConnection Propriété

Définition

Obtient une valeur indiquant si la connexion HTTP est sécurisée (c'est-à-dire de type HTTPS).

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

Valeur de propriété

Boolean

true s'il s'agit d'une connexion SSL ; sinon, false.

Exemples

L’exemple de code suivant détermine si la propriété a la IsSecureConnection valeur false. Si c’est le cas, la propriété a la SuppressContent valeur true pour empêcher l’envoi de la réponse.

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

S’applique à