Share via


HttpRequest.IsSecureConnection Propriedade

Definição

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

Valor da propriedade

Boolean

true se a conexão for SSL; caso contrário, false.

Exemplos

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

Aplica-se a