HttpRequest.IsSecureConnection Propriedade
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém um valor que indica se a conexão HTTP usa SSL (ou seja, HTTPS).
public:
property bool IsSecureConnection { bool get(); };
public bool IsSecureConnection { get; }
member this.IsSecureConnection : bool
Public ReadOnly Property IsSecureConnection As Boolean
true
se a conexão for SSL; caso contrário, false
.
O exemplo de código a seguir determina se a IsSecureConnection propriedade está definida como false. Se for, a SuppressContent propriedade será definida como true para impedir que a resposta seja enviada.
// 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
Produto | Versões |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 |