System.IO.IOException Class

public class IOException : SystemException

Base Types

Object
  Exception
    SystemException
      IOException

Assembly

mscorlib

Library

BCL

Summary

Represents the error that occurs when an I/O operation fails.

Description

IOException is the base class for exceptions thrown while accessing information using streams, files and directories.

[Note: The Base Class Library includes the following types, each of which is derived from IOException:

Where appropriate, use these types instead of IOException.

]

See Also

System.IO Namespace

Members

IOException Constructors

IOException() Constructor
IOException(System.String) Constructor
IOException(System.String, System.Exception) Constructor


IOException() Constructor

public IOException();

Summary

Constructs and initializes a new instance of the IOException class.

Description

The constructor initializes the System.IO.IOException.Message property of the new instance to a system-supplied message that describes the error, such as "An I/O error occurred while performing the requested operation." This message takes into account the current system culture.

The System.IO.IOException.InnerException property of the new instance is initialized to null .

See Also

System.IO.IOException Class, System.IO Namespace

IOException(System.String) Constructor

public IOException(string message);

Summary

Constructs and initializes a new instance of the IOException class.

Parameters

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.

Description

The constructor initializes the System.IO.IOException.Message property of the new instance using message. If message is null , the System.IO.IOException.Message property is initialized to a system-supplied message.

The System.IO.IOException.InnerException property of the new instance is initialized to null .

See Also

System.IO.IOException Class, System.IO Namespace

IOException(System.String, System.Exception) Constructor

public IOException(string message, Exception innerException);

Summary

Constructs and initializes a new instance of the IOException class.

Parameters

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.
innerException
An instance of Exception that is the cause of the current exception. If innerException is non-null, then the current Exception was raised in a catch block handling innerException.

Description

The constructor initializes the System.IO.IOException.Message property of the new instance using message and the System.IO.IOException.InnerException property using innerException. If message is null , the System.IO.IOException.Message property is initialized to a system-supplied message.

[Note: For more information on inner exceptions, see System.Exception.InnerException.]

See Also

System.IO.IOException Class, System.IO Namespace