Class IOException
The exception that is thrown when an I/O error occurs.
Inherited Members
Namespace: System.IO
Assembly: mscorlib.dll
Syntax
public class IOException : SystemException
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.
Declaration
public IOException()
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.
Declaration
public IOException(string message, Exception innerException)
Parameters
Type | Name | Description |
---|---|---|
string | message | The error message that explains the reason for the exception. |
Exception | innerException | 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.
Declaration
public IOException(string message, int hresult)
Parameters
Type | Name | Description |
---|---|---|
string | message | 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. |
int | hresult | An integer identifying the error that has occurred. |
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).
Declaration
public IOException(string message)
Parameters
Type | Name | Description |
---|---|---|
string | message | 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. |
Properties
ErrorCode
The error code associated with this IOException object.
Declaration
public IOException.IOExceptionErrorCode ErrorCode { get; }
Property Value
Type | Description |
---|---|
IOException.IOExceptionErrorCode | The error code. |