Table of Contents

Class IOException

Namespace
System.IO
Assembly
mscorlib.dll

The exception that is thrown when an I/O error occurs.

public class IOException : SystemException
Inheritance
IOException
Inherited Members
Extension Methods

Constructors

IOException()

Initializes a new instance of the IOException class with its message string set to the empty string (""), its HRESULT set to COR_E_IO, and its inner exception set to a null reference.

public IOException()

IOException(string)

Initializes a new instance of the IOException class with its message string set to message, its HRESULT set to COR_E_IO, and its inner exception set to null reference (Nothing in Visual Basic).

public IOException(string message)

Parameters

message string

A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

IOException(string, Exception)

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

public IOException(string message, Exception innerException)

Parameters

message string

The error message that explains the reason for the exception.

innerException Exception

The exception that is the cause of the current exception. If the innerException parameter is not null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.

IOException(string, int)

Initializes a new instance of the IOException class with its message string set to message and its HRESULT user-defined.

public IOException(string message, int hresult)

Parameters

message string

A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

hresult int

An integer identifying the error that has occurred.

Properties

ErrorCode

The error code associated with this IOException object.

public IOException.IOExceptionErrorCode ErrorCode { get; }

Property Value

IOException.IOExceptionErrorCode

The error code.