FileLoadException 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 FileLoadException 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| FileLoadException() |
初始化类的新实例,将Message新实例FileLoadException的属性设置为系统提供的消息,该消息描述错误,例如“无法加载指定的文件”。此消息将考虑当前系统区域性。 |
| FileLoadException(String) |
使用指定的错误消息初始化类的新实例 FileLoadException 。 |
| FileLoadException(SerializationInfo, StreamingContext) |
已过时.
使用序列化数据初始化类的新实例 FileLoadException 。 |
| FileLoadException(String, Exception) |
使用指定的错误消息和对作为此异常原因的内部异常的引用初始化类的新实例 FileLoadException 。 |
| FileLoadException(String, String) |
使用指定的错误消息和无法加载的文件的名称初始化类的新实例 FileLoadException 。 |
| FileLoadException(String, String, Exception) |
使用指定的错误消息、无法加载的文件的名称和对导致此异常的内部异常的引用初始化类的新实例 FileLoadException 。 |
FileLoadException()
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
初始化类的新实例,将Message新实例FileLoadException的属性设置为系统提供的消息,该消息描述错误,例如“无法加载指定的文件”。此消息将考虑当前系统区域性。
public:
FileLoadException();
public FileLoadException();
Public Sub New ()
注解
新 InnerException 实例的属性和 FileName 属性初始化为 null。
另请参阅
适用于
FileLoadException(String)
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
使用指定的错误消息初始化类的新实例 FileLoadException 。
public:
FileLoadException(System::String ^ message);
public FileLoadException(string message);
public FileLoadException(string? message);
new System.IO.FileLoadException : string -> System.IO.FileLoadException
Public Sub New (message As String)
参数
注解
此构造函数使用 message.. 初始化Message新实例的属性。 新 InnerException 实例的属性和 FileName 属性初始化为 null。
另请参阅
适用于
FileLoadException(SerializationInfo, StreamingContext)
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
注意
This API supports obsolete formatter-based serialization. It should not be called or extended by application code.
使用序列化数据初始化类的新实例 FileLoadException 。
protected:
FileLoadException(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 FileLoadException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
protected FileLoadException(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.FileLoadException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileLoadException
new System.IO.FileLoadException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.FileLoadException
Protected Sub New (info As SerializationInfo, context As StreamingContext)
参数
- info
- SerializationInfo
保存所引发异常的序列化对象数据的 SerializationInfo。
- context
- StreamingContext
包含有关源或目标的上下文信息的 StreamingContext。
- 属性
另请参阅
适用于
FileLoadException(String, Exception)
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
使用指定的错误消息和对作为此异常原因的内部异常的引用初始化类的新实例 FileLoadException 。
public:
FileLoadException(System::String ^ message, Exception ^ inner);
public FileLoadException(string message, Exception inner);
public FileLoadException(string? message, Exception? inner);
new System.IO.FileLoadException : string * Exception -> System.IO.FileLoadException
Public Sub New (message As String, inner As Exception)
参数
- inner
- Exception
是当前异常原因的异常。
inner如果参数不是null,则当前异常在处理内部异常的块中catch引发。
注解
作为上一个异常的直接结果引发的异常应包含对属性中上一异常的 InnerException 引用。 该 InnerException 属性返回传入构造函数的相同值,或者 null 该 InnerException 属性未向构造函数提供内部异常值。
下表显示了实例 FileLoadException的初始属性值。
| 财产 | 价值 |
|---|---|
| InnerException | 内部异常引用。 |
| Message | 错误消息字符串。 |
有关内部异常的详细信息,请参阅 InnerException。
另请参阅
适用于
FileLoadException(String, String)
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
使用指定的错误消息和无法加载的文件的名称初始化类的新实例 FileLoadException 。
public:
FileLoadException(System::String ^ message, System::String ^ fileName);
public FileLoadException(string message, string fileName);
public FileLoadException(string? message, string? fileName);
new System.IO.FileLoadException : string * string -> System.IO.FileLoadException
Public Sub New (message As String, fileName As String)
参数
注解
此构造函数初始化 Message 新实例的属性 message 以及 FileName 使用该 fileName属性的属性。 新 InnerException 实例的属性初始化为 null.
FileName 不需要是存储在磁盘上的文件;它可以是支持流访问的系统的任何部分。 例如,根据系统,此类可能能够访问物理设备。
另请参阅
适用于
FileLoadException(String, String, Exception)
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
- Source:
- FileLoadException.cs
使用指定的错误消息、无法加载的文件的名称和对导致此异常的内部异常的引用初始化类的新实例 FileLoadException 。
public:
FileLoadException(System::String ^ message, System::String ^ fileName, Exception ^ inner);
public FileLoadException(string message, string fileName, Exception inner);
public FileLoadException(string? message, string? fileName, Exception? inner);
new System.IO.FileLoadException : string * string * Exception -> System.IO.FileLoadException
Public Sub New (message As String, fileName As String, inner As Exception)
参数
- inner
- Exception
是当前异常原因的异常。
inner如果参数不是null,则当前异常在处理内部异常的块中catch引发。
注解
作为上一个异常的直接结果引发的异常应包含对属性中上一异常的 InnerException 引用。 该 InnerException 属性返回传入构造函数的相同值,或者 null 该 InnerException 属性未向构造函数提供内部异常值。
FileName 不需要是存储在磁盘上的文件;它可以是支持流访问的系统的任何部分。 例如,根据系统,此类可能能够访问物理设备。
下表显示了实例 FileLoadException的初始属性值。
| 财产 | 价值 |
|---|---|
| InnerException | 内部异常引用。 |
| Message | 错误消息字符串。 |
有关内部异常的详细信息,请参阅 InnerException。