DriveNotFoundException 构造函数

定义

初始化 DriveNotFoundException 类的新实例。

重载

名称 说明
DriveNotFoundException()

初始化类的新实例 DriveNotFoundException ,其消息字符串设置为系统提供的消息,并将其 HRESULT 设置为COR_E_DIRECTORYNOTFOUND。

DriveNotFoundException(String)

使用指定的消息字符串和 HRESULT 设置为COR_E_DIRECTORYNOTFOUND初始化类的新实例 DriveNotFoundException

DriveNotFoundException(SerializationInfo, StreamingContext)
已过时.

使用指定的序列化和上下文信息初始化 DriveNotFoundException 类的新实例。

DriveNotFoundException(String, Exception)

使用指定的错误消息和对作为此异常原因的内部异常的引用初始化 DriveNotFoundException 类的新实例。

DriveNotFoundException()

Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs

初始化类的新实例 DriveNotFoundException ,其消息字符串设置为系统提供的消息,并将其 HRESULT 设置为COR_E_DIRECTORYNOTFOUND。

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

注解

此构造函数将 Exception.Message 新实例的属性初始化为系统提供的消息,该消息描述错误,例如“找不到指定的目录”。此消息基于当前系统区域性进行本地化。

Exception.InnerException 实例的属性初始化为 null.

另请参阅

适用于

DriveNotFoundException(String)

Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs

使用指定的消息字符串和 HRESULT 设置为COR_E_DIRECTORYNOTFOUND初始化类的新实例 DriveNotFoundException

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

参数

message
String

描述 String 错误的对象。 此构造函数的调用方必须确保此字符串已本地化为当前系统区域性。

注解

此构造函数使用Exception.Message参数初始化message新实例的属性。

Exception.InnerException 实例的属性初始化为 null.

另请参阅

适用于

DriveNotFoundException(SerializationInfo, StreamingContext)

Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs

注意

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

使用指定的序列化和上下文信息初始化 DriveNotFoundException 类的新实例。

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

参数

info
SerializationInfo

包含 SerializationInfo 有关所引发异常的序列化对象数据的对象。

context
StreamingContext

一个 StreamingContext 对象,其中包含有关所引发异常的源或目标的上下文信息。

属性

另请参阅

适用于

DriveNotFoundException(String, Exception)

Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs
Source:
DriveNotFoundException.cs

使用指定的错误消息和对作为此异常原因的内部异常的引用初始化 DriveNotFoundException 类的新实例。

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

参数

message
String

解释异常原因的错误消息。

innerException
Exception

是当前异常原因的异常。 如果未 innerExceptionnull 参数,则会在处理内部异常的 catch 块中引发当前异常。

注解

作为上一个异常的直接结果引发的异常应包括对 InnerException 属性中上一个异常的引用。 InnerException 属性返回传入构造函数的相同值,或者如果 null 属性未向构造函数提供内部异常值,则返回 InnerException

下表显示了 DirectoryNotFoundException实例的初始属性值。

财产 价值
InnerException 内部异常引用。
Message 错误消息字符串。

另请参阅

适用于