IOException Class

Definition

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

[Serializable]
[ComVisible(true)]
public class IOException : SystemException, ISerializable, _Exception
Inheritance
IOException
Derived

Inherited Members

System.Exception

System.Object

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.

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, the current exception is raised in a catch block that handles the inner exception.

See Also

IOException(String, Int32)

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
Int32

An integer identifying the error that has occurred.

See Also