IOException クラスとは? わかりやすく解説

IOException クラス

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

名前空間: System.IO
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Class IOException
    Inherits SystemException
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public class IOException : SystemException
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public ref class IOException : public
 SystemException
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public class IOException extends SystemException
SerializableAttribute 
ComVisibleAttribute(true) 
public class IOException extends
 SystemException
解説解説

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

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

  • DirectoryNotFoundException

  • EndOfStreamException

  • FileNotFoundException

  • FileLoadException

  • PathTooLongException

該当する場合は、IOException ではなくここで示した型を使用してください

IOException は、値 0x80131620 の HRESULT COR_E_IO を使用します

使用例使用例

次のコード例は FileStream.Lock メソッド例の一部です。

' 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
// 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(IOException e) {                        
    Console.WriteLine(
        "{0}: The write operation could not "
        + "be performed because the specified "
        + "part of the file is locked.", 
        e.GetType().get_Name());
}
継承階層継承階層
System.Object
   System.Exception
     System.SystemException
      System.IO.IOException
         派生クラス
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からIOException クラスを検索した結果を表示しています。
Weblioに収録されているすべての辞書からIOException クラスを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からIOException クラスを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「IOException クラス」の関連用語

IOException クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



IOException クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS