HttpRequest.IsSecureConnection Propriedade

Definição

Recebe um valor que indica se a ligação HTTP usa sockets seguros (ou seja, HTTPS).

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

Valor de Propriedade

true se a ligação for uma ligação SSL; caso contrário, false.

Exemplos

O seguinte exemplo de código determina se a IsSecureConnection propriedade está definida como falsa. Se for, a SuppressContent propriedade é 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