HRESULT エラー コードを指定して、CryptographicException クラスの新しいインスタンスを初期化します。
名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文
'宣言
Public Sub New ( _
hr As Integer _
)
'使用
Dim hr As Integer
Dim instance As New CryptographicException(hr)
public CryptographicException (
int hr
)
public:
CryptographicException (
int hr
)
public CryptographicException (
int hr
)
public function CryptographicException (
hr : int
)
適用できません。
パラメータ
- hr
HRESULT エラー コード。
解説
CryptographicException コンストラクタは、システム HRESULT エラー コードを受け取り、HRESULT に対応するローカライズされたメッセージを Message プロパティに設定します。
CryptographicException のインスタンスの初期プロパティ値を次の表に示します。
プロパティ |
値 |
---|---|
null 参照 (Visual Basic では Nothing). |
|
Message |
ローカライズされたエラー メッセージ文字列。 |
使用例
CryptographicUnexpectedOperationException に対するエラー コードを使用して CryptographicException を生成する方法を次のコード例に示します。このコード例は、CryptographicException クラスのトピックで取り上げているコード例の一部分です。
Dim exceptionNumber As Integer = &H80131431
Dim cryptographicException As _
New CryptographicException(exceptionNumber)
int exceptionNumber = unchecked((int)0x80131431);
CryptographicException cryptographicException =
new CryptographicException(exceptionNumber);
int exceptionNumber = (int)0x80131431;
CryptographicException^ cryptographicException = gcnew CryptographicException( exceptionNumber );
プラットフォーム
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
.NET Compact Framework
サポート対象 : 2.0
参照
関連項目
CryptographicException クラス
CryptographicException メンバ
System.Security.Cryptography 名前空間