DriveNotFoundException DriveNotFoundException DriveNotFoundException DriveNotFoundException Constructors

Definition

Overloads

DriveNotFoundException() DriveNotFoundException() DriveNotFoundException()

Initializes a new instance of the DriveNotFoundException class with its message string set to a system-supplied message and its HRESULT set to COR_E_DIRECTORYNOTFOUND.

DriveNotFoundException(String) DriveNotFoundException(String) DriveNotFoundException(String) DriveNotFoundException(String)

Initializes a new instance of the DriveNotFoundException class with the specified message string and the HRESULT set to COR_E_DIRECTORYNOTFOUND.

DriveNotFoundException(SerializationInfo, StreamingContext) DriveNotFoundException(SerializationInfo, StreamingContext) DriveNotFoundException(SerializationInfo, StreamingContext) DriveNotFoundException(SerializationInfo, StreamingContext)

Initializes a new instance of the DriveNotFoundException class with the specified serialization and context information.

DriveNotFoundException(String, Exception) DriveNotFoundException(String, Exception) DriveNotFoundException(String, Exception) DriveNotFoundException(String, Exception)

Initializes a new instance of the DriveNotFoundException class with the specified error message and a reference to the inner exception that is the cause of this exception.

DriveNotFoundException() DriveNotFoundException() DriveNotFoundException()

Initializes a new instance of the DriveNotFoundException class with its message string set to a system-supplied message and its HRESULT set to COR_E_DIRECTORYNOTFOUND.

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

Remarks

This constructor initializes the Exception.Message property of the new instance to a system-supplied message that describes the error, such as "Could not find the specified directory." This message is localized based on the current system culture.

The Exception.InnerException property of the new instance is initialized to null.

See also

DriveNotFoundException(String) DriveNotFoundException(String) DriveNotFoundException(String) DriveNotFoundException(String)

Initializes a new instance of the DriveNotFoundException class with the specified message string and the HRESULT set to COR_E_DIRECTORYNOTFOUND.

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

Parameters

message
String String String String

A String object that describes the error. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Remarks

This constructor initializes the Exception.Message property of the new instance using the message parameter.

The Exception.InnerException property of the new instance is initialized to null.

See also

DriveNotFoundException(SerializationInfo, StreamingContext) DriveNotFoundException(SerializationInfo, StreamingContext) DriveNotFoundException(SerializationInfo, StreamingContext) DriveNotFoundException(SerializationInfo, StreamingContext)

Initializes a new instance of the DriveNotFoundException class with the specified serialization and context information.

protected:
 DriveNotFoundException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected DriveNotFoundException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.IO.DriveNotFoundException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.IO.DriveNotFoundException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo SerializationInfo SerializationInfo SerializationInfo

A SerializationInfo object that contains the serialized object data about the exception being thrown.

context
StreamingContext StreamingContext StreamingContext StreamingContext

A StreamingContext object that contains contextual information about the source or destination of the exception being thrown.

See also

DriveNotFoundException(String, Exception) DriveNotFoundException(String, Exception) DriveNotFoundException(String, Exception) DriveNotFoundException(String, Exception)

Initializes a new instance of the DriveNotFoundException class with the specified error message and a reference to the inner exception that is the cause of this exception.

public:
 DriveNotFoundException(System::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)

Parameters

message
String String String String

The error message that explains the reason for the exception.

innerException
Exception Exception Exception Exception

The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.

Remarks

An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the InnerException property. The InnerException property returns the same value that is passed into the constructor, or null if the InnerException property does not supply the inner exception value to the constructor.

The following table shows the initial property values for an instance of DirectoryNotFoundException.

Property Value
InnerException The inner exception reference.
Message The error message string.
See also

Applies to