CryptographicUnexpectedOperationException 构造函数

定义

初始化 CryptographicUnexpectedOperationException 类的新实例。

重载

CryptographicUnexpectedOperationException()

使用默认属性初始化 CryptographicUnexpectedOperationException 类的新实例。

CryptographicUnexpectedOperationException(String)

用指定的错误消息初始化 CryptographicUnexpectedOperationException 类的新实例。

CryptographicUnexpectedOperationException(SerializationInfo, StreamingContext)
已过时.

用序列化数据初始化 CryptographicUnexpectedOperationException 类的新实例。

CryptographicUnexpectedOperationException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 CryptographicUnexpectedOperationException 类的新实例。

CryptographicUnexpectedOperationException(String, String)

以指定格式使用指定的错误消息来初始化 CryptographicUnexpectedOperationException 类的新实例。

CryptographicUnexpectedOperationException()

Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs

使用默认属性初始化 CryptographicUnexpectedOperationException 类的新实例。

public:
 CryptographicUnexpectedOperationException();
public CryptographicUnexpectedOperationException ();
Public Sub New ()

示例

下面的代码示例演示如何构造 CryptographicUnexpectedOperationException 不带参数的 。 此代码示例是为 CryptographicUnexpectedOperationException 类提供的一个更大示例的一部分。

CryptographicUnexpectedOperationException cryptographicException =
    new CryptographicUnexpectedOperationException();
Dim cryptographicException As _
    New CryptographicUnexpectedOperationException

注解

下表显示了 CryptographicUnexpectedOperationException 实例的初始属性值。

properties
InnerException null.
Message 本地化的错误消息字符串。

适用于

CryptographicUnexpectedOperationException(String)

Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs

用指定的错误消息初始化 CryptographicUnexpectedOperationException 类的新实例。

public:
 CryptographicUnexpectedOperationException(System::String ^ message);
public CryptographicUnexpectedOperationException (string? message);
public CryptographicUnexpectedOperationException (string message);
new System.Security.Cryptography.CryptographicUnexpectedOperationException : string -> System.Security.Cryptography.CryptographicUnexpectedOperationException
Public Sub New (message As String)

参数

message
String

解释异常原因的错误消息。

示例

下面的代码示例演示如何使用自定义错误消息构造 CryptographicUnexpectedOperationException 。 此代码示例是为 CryptographicUnexpectedOperationException 类提供的一个更大示例的一部分。

string errorMessage = ("Unexpected operation exception.");
CryptographicUnexpectedOperationException cryptographicException =
    new CryptographicUnexpectedOperationException(errorMessage);
Dim errorMessage As String = "Unexpected operation exception."
Dim cryptographicException As _
    New CryptographicUnexpectedOperationException(errorMessage)

注解

下表显示了 CryptographicUnexpectedOperationException 实例的初始属性值。

properties
InnerException null.
Message 错误消息字符串。

适用于

CryptographicUnexpectedOperationException(SerializationInfo, StreamingContext)

Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs

注意

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

用序列化数据初始化 CryptographicUnexpectedOperationException 类的新实例。

protected:
 CryptographicUnexpectedOperationException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected CryptographicUnexpectedOperationException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected CryptographicUnexpectedOperationException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Security.Cryptography.CryptographicUnexpectedOperationException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.Cryptography.CryptographicUnexpectedOperationException
[<System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Security.Cryptography.CryptographicUnexpectedOperationException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Security.Cryptography.CryptographicUnexpectedOperationException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

参数

info
SerializationInfo

承载序列化对象数据的对象。

context
StreamingContext

关于来源和目标的上下文信息

属性

注解

在反序列化期间调用此构造函数以重新构造在流上传输的异常对象。

适用于

CryptographicUnexpectedOperationException(String, Exception)

Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 CryptographicUnexpectedOperationException 类的新实例。

public:
 CryptographicUnexpectedOperationException(System::String ^ message, Exception ^ inner);
public CryptographicUnexpectedOperationException (string? message, Exception? inner);
public CryptographicUnexpectedOperationException (string message, Exception inner);
new System.Security.Cryptography.CryptographicUnexpectedOperationException : string * Exception -> System.Security.Cryptography.CryptographicUnexpectedOperationException
Public Sub New (message As String, inner As Exception)

参数

message
String

解释异常原因的错误消息。

inner
Exception

导致当前异常的异常。 如果 inner 参数不为 null,则当前异常将在处理内部异常的 catch 块中引发。

示例

下面的代码示例演示如何使用自定义错误消息和内部异常构造 CryptographicUnexpectedOperationException 。 此代码示例是为 CryptographicUnexpectedOperationException 类提供的一个更大示例的一部分。

string errorMessage = ("The current operation is not supported.");
NullReferenceException nullException = new NullReferenceException();
CryptographicUnexpectedOperationException cryptographicException = 
    new CryptographicUnexpectedOperationException(
    errorMessage, nullException);
Dim errorMessage As String = "The current operation is not supported."
Dim nullException As New NullReferenceException
Dim cryptographicException As _
    New CryptographicUnexpectedOperationException( _
    errorMessage, nullException)

注解

因前一个异常而直接引发的异常应在 InnerException 属性中包含对前一个异常的引用。 InnerException 属性将返回传递给构造函数的同一值;如果 InnerException 属性不向构造函数提供内部异常值,则返回 null

下表显示了 CryptographicUnexpectedOperationException 实例的初始属性值。

properties “值”
InnerException 内部异常引用。
Message 错误消息字符串。

另请参阅

适用于

CryptographicUnexpectedOperationException(String, String)

Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs
Source:
CryptographicUnexpectedOperationException.cs

以指定格式使用指定的错误消息来初始化 CryptographicUnexpectedOperationException 类的新实例。

public:
 CryptographicUnexpectedOperationException(System::String ^ format, System::String ^ insert);
public CryptographicUnexpectedOperationException (string format, string? insert);
public CryptographicUnexpectedOperationException (string format, string insert);
new System.Security.Cryptography.CryptographicUnexpectedOperationException : string * string -> System.Security.Cryptography.CryptographicUnexpectedOperationException
Public Sub New (format As String, insert As String)

参数

format
String

用于输出错误信息的格式。

insert
String

解释异常原因的错误消息。

示例

下面的代码示例演示如何使用时间格式和当前日期构造 CryptographicUnexpectedOperationException 。 此代码示例是为 CryptographicUnexpectedOperationException 类提供的一个更大示例的一部分。

string dateFormat = "{0:t}";
string timeStamp = (DateTime.Now.ToString());
CryptographicUnexpectedOperationException cryptographicException = 
    new CryptographicUnexpectedOperationException(
    dateFormat, timeStamp);
Dim dateFormat As String = "{0:t}"
Dim timeStamp As String = DateTime.Now.ToString()
Dim cryptographicException As New _
    CryptographicUnexpectedOperationException(dateFormat, timeStamp)

注解

下表显示了 CryptographicUnexpectedOperationException 实例的初始属性值。

properties
InnerException null.
Message 错误消息字符串。

适用于