IOException クラス

定義

I/O エラーが発生したときにスローされる例外。

public ref class IOException : Exception
public ref class IOException : SystemException
public class IOException : Exception
public class IOException : SystemException
[System.Serializable]
public class IOException : SystemException
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class IOException : SystemException
type IOException = class
    inherit Exception
type IOException = class
    inherit SystemException
[<System.Serializable>]
type IOException = class
    inherit SystemException
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type IOException = class
    inherit SystemException
Public Class IOException
Inherits Exception
Public Class IOException
Inherits SystemException
継承
IOException
継承
派生
属性

このコード例は、 メソッドに対して提供されるより大きな例の FileStream.Lock 一部です。

// Catch the IOException generated if the 
// specified part of the file is locked.
catch ( IOException^ e ) 
{
   Console::WriteLine( "{0}: The write operation could not "
   "be performed because the specified "
   "part of the file is locked.", e->GetType()->Name );
}
// Catch the IOException generated if the
// specified part of the file is locked.
catch(IOException e)
{
    Console.WriteLine(
        "{0}: The write operation could not " +
        "be performed because the specified " +
        "part of the file is locked.",
        e.GetType().Name);
}
' Catch the IOException generated if the 
' specified part of the file is locked.
Catch ex As IOException
    Console.WriteLine( _
        "{0}: The write operation could " & _
        "not be performed because the " & _
        "specified part of the file is " & _
        "locked.", ex.GetType().Name)
End Try

注釈

IOException は、ストリーム、ファイル、およびディレクトリを使用して情報にアクセスしているときにスローされる例外の基底クラスです。

基底クラス ライブラリには次の型が含まれています。それぞれの型は の IOException 派生クラスです。

必要に応じて、IOException の代わりにこれらの型を使用します。

IOException は、0x80131620値を持つ HRESULT COR_E_IOを使用します。

コンストラクター

IOException()

メッセージ文字列を空の文字列 ("") に、HRESULT を COR_E_IO に、内部の例外を null 参照に設定して、IOException クラスの新しいインスタンスを初期化します。

IOException(SerializationInfo, StreamingContext)
古い.

指定したシリアル化とコンテキスト情報を使用して、IOException クラスの新しいインスタンスを初期化します。

IOException(String)

メッセージ文字列を message に設定し、HRESULT を COR_E_IO に設定し、内部の例外を null に設定して、IOException クラスの新しいインスタンスを初期化します。

IOException(String, Exception)

指定したエラー メッセージおよびこの例外の原因となった内部例外への参照を使用して、IOException クラスの新しいインスタンスを初期化します。

IOException(String, Int32)

メッセージ文字列を message に設定し、HRESULT をユーザー定義に設定して、IOException クラスの新しいインスタンスを初期化します。

プロパティ

Data

例外に関する追加のユーザー定義情報を提供する、キーと値のペアのコレクションを取得します。

(継承元 Exception)
HelpLink

この例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。

(継承元 Exception)
HResult

特定の例外に割り当てられているコード化数値である HRESULT を取得または設定します。

(継承元 Exception)
InnerException

現在の例外の原因となる Exception インスタンスを取得します。

(継承元 Exception)
Message

現在の例外を説明するメッセージを取得します。

(継承元 Exception)
Source

エラーの原因となるアプリケーションまたはオブジェクトの名前を取得または設定します。

(継承元 Exception)
StackTrace

呼び出し履歴で直前のフレームの文字列形式を取得します。

(継承元 Exception)
TargetSite

現在の例外がスローされたメソッドを取得します。

(継承元 Exception)

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetBaseException()

派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の根本原因である Exception を返します。

(継承元 Exception)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetObjectData(SerializationInfo, StreamingContext)
古い.

派生クラスでオーバーライドされた場合は、その例外に関する情報を使用して SerializationInfo を設定します。

(継承元 Exception)
GetType()

現在のインスタンスのランタイム型を取得します。

(継承元 Exception)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在の例外の文字列形式を作成して返します。

(継承元 Exception)

イベント

SerializeObjectState
古い.

例外がシリアル化され、例外に関するシリアル化されたデータを含む例外状態オブジェクトが作成されたときに発生します。

(継承元 Exception)

適用対象

こちらもご覧ください