次の方法で共有


FileNotFoundException コンストラクター

定義

オプションのメッセージ文字列と内部Exception参照を使用して、FileNotFoundException クラスの新しいインスタンスを初期化します。

オーバーロード

名前 説明
FileNotFoundException()

メッセージ文字列をシステム指定メッセージに設定して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

FileNotFoundException(String)

指定したエラー メッセージを使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

FileNotFoundException(SerializationInfo, StreamingContext)
古い.

指定したシリアル化とコンテキスト情報を使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

FileNotFoundException(String, Exception)

指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

FileNotFoundException(String, String)

指定したエラー メッセージと見つからないファイル名を使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

FileNotFoundException(String, String, Exception)

指定したエラー メッセージ、見つからないファイル名、およびこの例外の原因である内部例外への参照を使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

FileNotFoundException()

ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs

メッセージ文字列をシステム指定メッセージに設定して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

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

注釈

このコンストラクターは、新しいインスタンスの Message プロパティを、"指定されたファイルが見つかりませんでした" などのエラーを説明するシステム指定のメッセージに初期化します。このメッセージでは、現在のシステム カルチャが考慮されます。

こちらもご覧ください

適用対象

FileNotFoundException(String)

ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs

指定したエラー メッセージを使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

public:
 FileNotFoundException(System::String ^ message);
public FileNotFoundException(string message);
public FileNotFoundException(string? message);
new System.IO.FileNotFoundException : string -> System.IO.FileNotFoundException
Public Sub New (message As String)

パラメーター

message
String

エラーの説明。 messageの内容は、人間が理解することを意図しています。 このコンストラクターの呼び出し元は、この文字列が現在のシステム カルチャ用にローカライズされていることを確認する必要があります。

注釈

このコンストラクターは、messageを使用して新しいインスタンスのMessage プロパティを初期化します。

こちらもご覧ください

適用対象

FileNotFoundException(SerializationInfo, StreamingContext)

ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs

注意事項

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

指定したシリアル化とコンテキスト情報を使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

protected:
 FileNotFoundException(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 FileNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected FileNotFoundException(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}")>]
new System.IO.FileNotFoundException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileNotFoundException
new System.IO.FileNotFoundException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileNotFoundException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

パラメーター

info
SerializationInfo

スローされる例外に関するシリアル化されたオブジェクト データを保持するオブジェクト。

context
StreamingContext

ソースまたは変換先に関するコンテキスト情報を含むオブジェクト。

属性

こちらもご覧ください

適用対象

FileNotFoundException(String, Exception)

ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs

指定したエラー メッセージと、この例外の原因である内部例外への参照を使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

public:
 FileNotFoundException(System::String ^ message, Exception ^ innerException);
public FileNotFoundException(string message, Exception innerException);
public FileNotFoundException(string? message, Exception? innerException);
new System.IO.FileNotFoundException : string * Exception -> System.IO.FileNotFoundException
Public Sub New (message As String, innerException As Exception)

パラメーター

message
String

エラーの説明。 messageの内容は、人間が理解することを意図しています。 このコンストラクターの呼び出し元は、この文字列が現在のシステム カルチャ用にローカライズされていることを確認する必要があります。

innerException
Exception

現在の例外の原因である例外。 innerException パラメーターがnullされていない場合、内部例外を処理するcatch ブロックで現在の例外が発生します。

注釈

前の例外の直接の結果としてスローされる例外は、 InnerException プロパティに前の例外への参照を含める必要があります。 InnerException プロパティは、コンストラクターに渡されるのと同じ値を返します。または、null プロパティがコンストラクターに内部例外値を提供しない場合はInnerExceptionします。

次の表に、 FileNotFoundExceptionのインスタンスの初期プロパティ値を示します。

財産 価値
InnerException 内部例外参照。
Message エラー メッセージ文字列。

内部例外の詳細については、 InnerExceptionを参照してください。

こちらもご覧ください

適用対象

FileNotFoundException(String, String)

ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs

指定したエラー メッセージと見つからないファイル名を使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

public:
 FileNotFoundException(System::String ^ message, System::String ^ fileName);
public FileNotFoundException(string message, string fileName);
public FileNotFoundException(string? message, string? fileName);
new System.IO.FileNotFoundException : string * string -> System.IO.FileNotFoundException
Public Sub New (message As String, fileName As String)

パラメーター

message
String

エラーの説明。指定されたfileNameでシステム指定のメッセージを使用するnullmessageの内容は人間が理解する必要があります。 このコンストラクターの呼び出し元は、この文字列が現在のシステム カルチャ用にローカライズされていることを確認する必要があります。

fileName
String

無効なイメージを持つファイルの完全な名前。

注釈

コンストラクターは、message を使用して新しいインスタンスのMessage プロパティを初期化し、fileNameを使用して FileName プロパティを初期化します。

こちらもご覧ください

適用対象

FileNotFoundException(String, String, Exception)

ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs
ソース:
FileNotFoundException.cs

指定したエラー メッセージ、見つからないファイル名、およびこの例外の原因である内部例外への参照を使用して、 FileNotFoundException クラスの新しいインスタンスを初期化します。

public:
 FileNotFoundException(System::String ^ message, System::String ^ fileName, Exception ^ innerException);
public FileNotFoundException(string message, string fileName, Exception innerException);
public FileNotFoundException(string? message, string? fileName, Exception? innerException);
new System.IO.FileNotFoundException : string * string * Exception -> System.IO.FileNotFoundException
Public Sub New (message As String, fileName As String, innerException As Exception)

パラメーター

message
String

例外の理由を説明するエラー メッセージ。

fileName
String

無効なイメージを持つファイルの完全な名前。

innerException
Exception

現在の例外の原因である例外。 innerException パラメーターがnullされていない場合、内部例外を処理するcatch ブロックで現在の例外が発生します。

注釈

前の例外の直接の結果としてスローされる例外は、 InnerException プロパティに前の例外への参照を含める必要があります。 InnerException プロパティは、コンストラクターに渡されるのと同じ値を返します。または、null プロパティがコンストラクターに内部例外値を提供しない場合はInnerExceptionします。

次の表に、 FileNotFoundExceptionのインスタンスの初期プロパティ値を示します。

財産 価値
InnerException 内部例外参照。
Message エラー メッセージ文字列。

内部例外の詳細については、 InnerExceptionを参照してください。

こちらもご覧ください

適用対象