ProtocolViolationException 构造函数

定义

初始化 ProtocolViolationException 类的新实例。Initializes a new instance of the ProtocolViolationException class.

重载

ProtocolViolationException()

初始化 ProtocolViolationException 类的新实例。Initializes a new instance of the ProtocolViolationException class.

ProtocolViolationException(String)

使用指定的消息初始化 ProtocolViolationException 类的新实例。Initializes a new instance of the ProtocolViolationException class with the specified message.

ProtocolViolationException(SerializationInfo, StreamingContext)

根据指定的 ProtocolViolationExceptionSerializationInfo 实例初始化 StreamingContext 类的新实例。Initializes a new instance of the ProtocolViolationException class from the specified SerializationInfo and StreamingContext instances.

ProtocolViolationException()

初始化 ProtocolViolationException 类的新实例。Initializes a new instance of the ProtocolViolationException class.

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

注解

Message 属性被初始化为系统提供的描述错误的消息。The Message property is initialized to a system-supplied message that describes the error. InnerException 属性初始化为 nullThe InnerException property is initialized to null.

ProtocolViolationException(String)

使用指定的消息初始化 ProtocolViolationException 类的新实例。Initializes a new instance of the ProtocolViolationException class with the specified message.

public:
 ProtocolViolationException(System::String ^ message);
public ProtocolViolationException (string message);
new System.Net.ProtocolViolationException : string -> System.Net.ProtocolViolationException
Public Sub New (message As String)

参数

message
String

错误消息字符串。The error message string.

注解

此构造函数初始化 ProtocolViolationException 类的新实例,Message 属性设置为 message 参数的值。This constructor initializes a new instance of the ProtocolViolationException class with the Message property set to the value of the message parameter. 如果 message 为空引用,则 Message 属性将初始化为系统提供的消息。If message is a null reference, the Message property is initialized to a system-supplied message. InnerException 属性初始化为 nullThe InnerException property is initialized to null.

ProtocolViolationException(SerializationInfo, StreamingContext)

根据指定的 ProtocolViolationExceptionSerializationInfo 实例初始化 StreamingContext 类的新实例。Initializes a new instance of the ProtocolViolationException class from the specified SerializationInfo and StreamingContext instances.

protected:
 ProtocolViolationException(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected ProtocolViolationException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.ProtocolViolationException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.ProtocolViolationException

参数

serializationInfo
SerializationInfo

SerializationInfo,包含反序列化 ProtocolViolationException 所需的信息。A SerializationInfo that contains the information that is required to deserialize the ProtocolViolationException.

streamingContext
StreamingContext

StreamingContext,它包含与新的 ProtocolViolationException 关联的序列化流的源。A StreamingContext that contains the source of the serialized stream that is associated with the new ProtocolViolationException.

注解

此构造函数实现 ProtocolViolationException 类的 ISerializable 接口。This constructor implements the ISerializable interface for the ProtocolViolationException class.

另请参阅

适用于