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