UriFormatException 建構函式

定義

初始化 UriFormatException 類別的新執行個體。

多載

UriFormatException()

初始化 UriFormatException 類別的新執行個體。

UriFormatException(String)

使用指定的訊息初始化 UriFormatException 類別的新執行個體。

UriFormatException(SerializationInfo, StreamingContext)
已淘汰.

從指定的 UriFormatExceptionSerializationInfo 執行個體,初始化 StreamingContext 類別的新執行個體。

UriFormatException(String, Exception)

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 UriFormatException 類別的新執行個體。

UriFormatException()

來源:
UriFormatException.cs
來源:
UriFormatException.cs
來源:
UriFormatException.cs

初始化 UriFormatException 類別的新執行個體。

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

備註

無參數建構函式會初始化 類別的新實例, UriFormatException 並將所有欄位設定為 null

適用於

UriFormatException(String)

來源:
UriFormatException.cs
來源:
UriFormatException.cs
來源:
UriFormatException.cs

使用指定的訊息初始化 UriFormatException 類別的新執行個體。

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

參數

textString
String

錯誤訊息字串。

備註

UriFormatException 建構函式會 UriFormatException 初始化 實例, Message 並將 屬性設定為 的值 textString

適用於

UriFormatException(SerializationInfo, StreamingContext)

來源:
UriFormatException.cs
來源:
UriFormatException.cs
來源:
UriFormatException.cs

警告

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

從指定的 UriFormatExceptionSerializationInfo 執行個體,初始化 StreamingContext 類別的新執行個體。

protected:
 UriFormatException(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected UriFormatException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[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 UriFormatException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new UriFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> UriFormatException
[<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 UriFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> UriFormatException
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

參數

serializationInfo
SerializationInfo

SerializationInfo,包含序列化新 UriFormatException 所需的資訊。

streamingContext
StreamingContext

StreamingContext,包含與新 UriFormatException 關聯之序列化資料流的來源。

屬性

備註

這個建構函式會 ISerializable 實作 類別的 UriFormatException 介面。

另請參閱

適用於

UriFormatException(String, Exception)

來源:
UriFormatException.cs
來源:
UriFormatException.cs
來源:
UriFormatException.cs

使用指定的錯誤訊息以及造成此例外狀況的內部例外狀況的參考,初始化 UriFormatException 類別的新執行個體。

public:
 UriFormatException(System::String ^ textString, Exception ^ e);
public UriFormatException (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

說明例外狀況的訊息。 需要此建構函式的呼叫者,才能確保此字串已針對目前的系統文化特性進行當地語系化。

e
Exception

做為目前例外狀況發生原因的例外狀況。 如果 innerException 參數不是 null,則目前的例外狀況會在處理內部例外的 catch 區塊中引發。

備註

被擲回以做為前一個例外狀況直接結果的例外狀況,應該在 InnerException 屬性中包含對前一個例外狀況的參考。 InnerException 屬性傳回的值會與傳入建構函式的值相同,或傳回 null (如果 InnerException 屬性未提供內部例外狀況值給建構函式)。

下表顯示 UriFormatException 執行個體的初始屬性值。

屬性
InnerException null.
Message message 中指定的錯誤訊息字串。

另請參閱

適用於