HttpRequest.IsSecureConnection Eigenschaft

Definition

Ruft einen Wert ab, der angibt, ob bei der HTTP-Verbindung Secure Sockets, d. h. HTTPS, verwendet wird.

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

Eigenschaftswert

true, wenn die Verbindung eine SSL-Verbindung ist, andernfalls false.

Beispiele

Im folgenden Codebeispiel wird bestimmt, ob die IsSecureConnection Eigenschaft auf false festgelegt ist. Wenn dies der Fall ist, wird die SuppressContent Eigenschaft auf TRUE festgelegt, um das Senden der Antwort zu verhindern.

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

Gilt für: