Поделиться через


HttpRequest.IsSecureConnection Свойство

Определение

Возвращает значение, указывающее, использует ли HTTP-подключение безопасные сокеты (то есть HTTPS).

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

Значение свойства

true Значение SSL-подключения; falseв противном случае .

Примеры

В следующем примере кода определяется, имеет ли IsSecureConnection свойство значение false. Если это так, свойство имеет значение true, SuppressContent чтобы остановить отправку ответа.

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

Применяется к