HttpRequest.IsSecureConnection プロパティ

セキュリティ設定されたソケットを HTTP 接続で使用しているどうか (つまり、HTTPS かどうか) を示す値を取得します。

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)

構文

'宣言
Public ReadOnly Property IsSecureConnection As Boolean
'使用
Dim instance As HttpRequest
Dim value As Boolean

value = instance.IsSecureConnection
public bool IsSecureConnection { get; }
public:
property bool IsSecureConnection {
    bool get ();
}
/** @property */
public boolean get_IsSecureConnection ()
public function get IsSecureConnection () : boolean
適用できません。

プロパティ値

接続に SSL を使用する場合は true。それ以外の場合は false

使用例

IsSecureConnection プロパティが false に設定されているかどうかを確認するコード例を次に示します。設定されている場合は、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
// Check whether the request is sent
// over HTTPS. If not, do not send 
// content to the client.    
if (!Request.IsSecureConnection)
{
    Response.SuppressContent = true;
}

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

参照

関連項目

HttpRequest クラス
HttpRequest メンバ
System.Web 名前空間