以下の内容はhttps://blog.systemjp.net/entry/2018/01/12/131711より取得しました。


C#/VB.netですべての例外をキャッチする

vb.net

Try
    'ファイルを開く
    sr = System.IO.File.OpenText(filePath)
Catch ex As System.IO.FileNotFoundException
    System.Console.WriteLine(ex.Message)
    Return Nothing
Catch ex As System.IO.IOException
    System.Console.WriteLine(ex.Message)
    Return Nothing
Catch ex As System.UnauthorizedAccessException
    System.Console.WriteLine(ex.Message)
    Return Nothing
Catch ex As System.Exception
    'すべての例外をキャッチする
    '例外の説明を表示する
    System.Console.WriteLine(ex.Message)
    Return Nothing
End Try

C#

try
{
    //ファイルを開く
    sr = System.IO.File.OpenText(filePath);
}
catch (System.IO.FileNotFoundException ex)
{
    System.Console.WriteLine(ex.Message);
    return null;
}
catch (System.IO.IOException ex)
{
    System.Console.WriteLine(ex.Message);
    return null;
}
catch (System.UnauthorizedAccessException ex)
{
    System.Console.WriteLine(ex.Message);
    return null;
}
catch (System.Exception ex)
{
    //すべての例外をキャッチする
    //例外の説明を表示する
    System.Console.WriteLine(ex.Message);
    return null;
}



以上の内容はhttps://blog.systemjp.net/entry/2018/01/12/131711より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14