UriFormatException UriFormatException UriFormatException UriFormatException Constructors

定义

重载

UriFormatException() UriFormatException() UriFormatException()

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

UriFormatException(String) UriFormatException(String) UriFormatException(String) UriFormatException(String)

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

UriFormatException(SerializationInfo, StreamingContext) UriFormatException(SerializationInfo, StreamingContext) UriFormatException(SerializationInfo, StreamingContext)

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

UriFormatException(String, Exception) UriFormatException(String, Exception) UriFormatException(String, Exception) UriFormatException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 UriFormatException 类的新实例。Initializes a new instance of the UriFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.

UriFormatException() UriFormatException() UriFormatException()

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

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

注解

无参数构造函数初始化UriFormatException类的新实例, 所有字段都设置为。 nullThe parameterless constructor initializes a new instance of the UriFormatException class with all fields set to null.

UriFormatException(String) UriFormatException(String) UriFormatException(String) UriFormatException(String)

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

public:
 UriFormatException(System::String ^ textString);
public UriFormatException (string textString);
new UriFormatException : string -> UriFormatException
Public Sub New (textString As String)

参数

textString
String String String String

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

注解

System.uriformatexception 构造函数初始化UriFormatException实例, Message并将属性textString设置为的值。The UriFormatException constructor initializes the UriFormatException instance with the Message property set to the value of textString.

UriFormatException(SerializationInfo, StreamingContext) UriFormatException(SerializationInfo, StreamingContext) UriFormatException(SerializationInfo, StreamingContext)

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

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

参数

serializationInfo
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

SerializationInfo,它包含序列化新的 UriFormatException 所需的信息。A SerializationInfo that contains the information that is required to serialize the new UriFormatException.

streamingContext
StreamingContext StreamingContext StreamingContext StreamingContext

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

注解

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

另请参阅

UriFormatException(String, Exception) UriFormatException(String, Exception) UriFormatException(String, Exception) UriFormatException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 UriFormatException 类的新实例。Initializes a new instance of the UriFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.

public:
 UriFormatException(System::String ^ textString, Exception ^ e);
public UriFormatException (string textString, Exception e);
new UriFormatException : string * Exception -> UriFormatException
Public Sub New (textString As String, e As Exception)

参数

textString
String String String String

描述该异常的消息。The message that describes the exception. 此构造函数的调用方需要确保此字符串已针对当前系统区域性进行了本地化。The caller of this constructor is required to ensure that this string has been localized for the current system culture.

e
Exception Exception Exception Exception

导致当前异常的异常。The exception that is the cause of the current exception. 如果 innerException 参数不为 null,则当前异常会在处理内部异常的 catch 块中引发。If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.

注解

因前一个异常而直接引发的异常应在 InnerException 属性中包含对前一个异常的引用。An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. InnerException 属性返回的值与传递到构造函数中的值相同;或者,如果 null 属性没有向构造函数提供内部异常值,则为 InnerExceptionThe InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

下表显示 UriFormatException 的实例的初始属性值。The following table shows the initial property values for an instance of UriFormatException.

PropertyProperty Value
InnerException nullnull.
Message message 中指定的错误消息字符串。The error message string specified in message.
另请参阅

适用于