Google
 
Web itpro-blogger.blogspot.com
木曜日, 7月 14, 2005

[VB.NET or VB2005]例外処理

■エラー取得
Dim strErrMsg As String
Dim intErrNo As Integer
Dim strErrDetail As String
Dim strErrType As String

Try

       ' 処理内容

Catch ex As Exception

strErrMsg = Err.Description
intErrNo = Err.Number
strErrDetail = ex.ToString()
strErrType = ex.GetType().ToString()

MsgBox("エラー内容:" & Err.Description & "(" & Err.Number & ")" & vbCrLf & _
"詳細内容:" & ex.ToString() & "(" & ex.GetType().ToString() & ")")

End Try

■Throwステートメント:プログラムの実行を中断し、プログラム内の関連するCatchブロックに制御を移す。


■参考サイト
【VB 例外 - Throw】
http://homepage1.nifty.com/rucio/main/dotnet/shokyu/standard33.htm






Comments: コメントを投稿

<< Home

This page is powered by Blogger. Isn't yours?