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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DirectoryNotFoundException クラスの意味・解説 

DirectoryNotFoundException クラス

ファイルまたはディレクトリ一部が見つからない場合スローされる例外

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

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

DirectoryNotFoundException は、値 0x80070003 の HRESULT COR_E_DIRECTORYNOTFOUND を使用しますDirectoryNotFoundException は、COM 相互運用プログラムが値 0x80030003 の HRESULT STG_E_PATHNOTFOUND を参照するときにもスローされるため注意してください

使用例使用例

DirectoryNotFoundException の強制的な発生や、DirectoryNotFoundException からの回復を行う方法次のコード例示します

Imports System.IO

Module Module1
    Sub Main()
        Try

            ' Specify a directory name that does not exist for this
 demo.
            Dim dir As String
 = "c:\78fe9lk"

            ' If this directory does not exist, a DirectoryNotFoundException
 is thrown
            ' when attempting to set the current directory.
            Directory.SetCurrentDirectory(dir)

        Catch ex As System.IO.DirectoryNotFoundException

            ' Let the user know that the directory did not exist.
            Console.WriteLine("Directory not found: "
 + ex.Message)
        End Try
    End Sub
End Module
継承階層継承階層
System.Object
   System.Exception
     System.SystemException
       System.IO.IOException
        System.IO.DirectoryNotFoundException
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「DirectoryNotFoundException クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS