FileFormatException 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
建立 FileFormatException 類別的新執行個體。
多載
| FileFormatException() |
建立 FileFormatException 類別的新執行個體。 |
| FileFormatException(String) |
使用指定的錯誤訊息建立 FileFormatException 類別的新執行個體。 |
| FileFormatException(Uri) |
使用來源 URI 值,建立 FileFormatException 類別的新執行個體。 |
| FileFormatException(SerializationInfo, StreamingContext) |
已淘汰.
建立 FileFormatException 類別的新執行個體,並使用序列化資料將它初始化。 這個建構函式是在還原序列化期間呼叫,以便重新組成透過資料流傳輸的例外狀況物件。 |
| FileFormatException(String, Exception) |
使用指定的錯誤訊息和例外狀況型別,建立 FileFormatException 類別的新執行個體。 |
| FileFormatException(Uri, Exception) |
使用來源 URI 值和例外狀況型別,建立 FileFormatException 類別的新執行個體。 |
| FileFormatException(Uri, String) |
使用來源 URI 值和指定的錯誤訊息,建立 FileFormatException 類別的新執行個體。 |
| FileFormatException(Uri, String, Exception) |
使用來源 URI 值、指定的錯誤訊息和例外狀況型別,建立 FileFormatException 類別的新執行個體。 |
FileFormatException()
建立 FileFormatException 類別的新執行個體。
public:
FileFormatException();
public FileFormatException ();
Public Sub New ()
備註
此建構函式會使用描述錯誤的預設系統訊息,例如「輸入檔或數據流不符合預期的檔案格式規格」。此訊息會將目前的系統文化特性納入考慮。
適用於
FileFormatException(String)
使用指定的錯誤訊息建立 FileFormatException 類別的新執行個體。
public:
FileFormatException(System::String ^ message);
public FileFormatException (string message);
public FileFormatException (string? message);
new System.IO.FileFormatException : string -> System.IO.FileFormatException
Public Sub New (message As String)
參數
適用於
FileFormatException(Uri)
使用來源 URI 值,建立 FileFormatException 類別的新執行個體。
public:
FileFormatException(Uri ^ sourceUri);
public FileFormatException (Uri sourceUri);
public FileFormatException (Uri? sourceUri);
new System.IO.FileFormatException : Uri -> System.IO.FileFormatException
Public Sub New (sourceUri As Uri)
參數
備註
這個建構函式會將 Message 新 FileFormatException 實例的 屬性初始化為系統提供的訊息,該訊息描述錯誤並包含檔名,例如「檔案』sourceUri『不符合預期的檔案格式規格」。此訊息會將目前的系統文化特性納入考慮。
屬性 SourceUri 是使用 sourceUri 參數初始化。
適用於
FileFormatException(SerializationInfo, StreamingContext)
警告
This API supports obsolete formatter-based serialization. It should not be called or extended by application code.
建立 FileFormatException 類別的新執行個體,並使用序列化資料將它初始化。 這個建構函式是在還原序列化期間呼叫,以便重新組成透過資料流傳輸的例外狀況物件。
protected:
FileFormatException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected FileFormatException (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 FileFormatException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.IO.FileFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileFormatException
[<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.IO.FileFormatException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileFormatException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
參數
- info
- SerializationInfo
存放序列物件資料的物件。
- context
- StreamingContext
關於來源或目的端的內容資訊。
- 屬性
適用於
FileFormatException(String, Exception)
使用指定的錯誤訊息和例外狀況型別,建立 FileFormatException 類別的新執行個體。
public:
FileFormatException(System::String ^ message, Exception ^ innerException);
public FileFormatException (string message, Exception innerException);
public FileFormatException (string? message, Exception? innerException);
new System.IO.FileFormatException : string * Exception -> System.IO.FileFormatException
Public Sub New (message As String, innerException As Exception)
參數
- innerException
- Exception
InnerException 屬性的值,代表目前例外狀況的原因。
備註
這個建構函式會Message使用 所message表示的指定錯誤訊息,初始化新FileFormatException實例的屬性。
適用於
FileFormatException(Uri, Exception)
使用來源 URI 值和例外狀況型別,建立 FileFormatException 類別的新執行個體。
public:
FileFormatException(Uri ^ sourceUri, Exception ^ innerException);
public FileFormatException (Uri sourceUri, Exception innerException);
public FileFormatException (Uri? sourceUri, Exception? innerException);
new System.IO.FileFormatException : Uri * Exception -> System.IO.FileFormatException
Public Sub New (sourceUri As Uri, innerException As Exception)
參數
- innerException
- Exception
InnerException 屬性的值,代表目前例外狀況的原因。
備註
這個建構函式會將新實例的 Message 屬性初始化為系統提供的訊息,該訊息描述錯誤並包含檔名,例如「檔案』sourceUri『不符合預期的檔案格式規格」。此訊息會將目前的系統文化特性納入考慮。
屬性 SourceUri 是使用 sourceUri 參數初始化。
適用於
FileFormatException(Uri, String)
使用來源 URI 值和指定的錯誤訊息,建立 FileFormatException 類別的新執行個體。
public:
FileFormatException(Uri ^ sourceUri, System::String ^ message);
public FileFormatException (Uri sourceUri, string message);
public FileFormatException (Uri? sourceUri, string? message);
new System.IO.FileFormatException : Uri * string -> System.IO.FileFormatException
Public Sub New (sourceUri As Uri, message As String)
參數
備註
這個建構函式會Message使用 所message表示的指定錯誤訊息,初始化新FileFormatException實例的屬性。 需要此建構函式的呼叫者,才能確保此字串已針對目前的系統文化特性進行當地語系化。
屬性 SourceUri 是使用 sourceUri 參數初始化。
適用於
FileFormatException(Uri, String, Exception)
使用來源 URI 值、指定的錯誤訊息和例外狀況型別,建立 FileFormatException 類別的新執行個體。
public:
FileFormatException(Uri ^ sourceUri, System::String ^ message, Exception ^ innerException);
public FileFormatException (Uri sourceUri, string message, Exception innerException);
public FileFormatException (Uri? sourceUri, string? message, Exception? innerException);
new System.IO.FileFormatException : Uri * string * Exception -> System.IO.FileFormatException
Public Sub New (sourceUri As Uri, message As String, innerException As Exception)
參數
- innerException
- Exception
InnerException 屬性的值,代表目前例外狀況的原因。
備註
這個建構函式會使用 message 參數,初始化新實例的 Message 屬性。 需要此建構函式的呼叫者,才能確保此字串已針對目前的系統文化特性進行當地語系化。
屬性 SourceUri 是使用 sourceUri 參數初始化。