ErrorEventArgs.GetException メソッド
アセンブリ: System (system.dll 内)

Dim instance As ErrorEventArgs Dim returnValue As Exception returnValue = instance.GetException
発生したエラーを表す Exception。

ErrorEventArgs の新しいインスタンスを作成し、そのインスタンスを Exception を使用して初期化する例を次に示します。次に GetException を呼び出して Exception を取得し、エラー メッセージを表示します。このコードに関連付けられたフォームはありません。
Public Shared Sub Main() 'Creates an exception with an error message. Dim myException As New Exception("This is an exception test") 'Creates an ErrorEventArgs with the exception. Dim myErrorEventArgs As New ErrorEventArgs(myException) 'Extracts the exception from the ErrorEventArgs and display it. Dim myReturnedException As Exception = myErrorEventArgs.GetException() MessageBox.Show("The returned exception is: " _ + myReturnedException.Message) End Sub
public static void Main(string[] args) { //Creates an exception with an error message. Exception myException= new Exception("This is an exception test"); //Creates an ErrorEventArgs with the exception. ErrorEventArgs myErrorEventArgs = new ErrorEventArgs(myException); //Extracts the exception from the ErrorEventArgs and display it. Exception myReturnedException = myErrorEventArgs.GetException(); MessageBox.Show("The returned exception is: " + myReturnedException.Message); }
int main() { //Creates an exception with an error message. Exception^ myException = gcnew Exception( "This is an exception test" ); //Creates an ErrorEventArgs with the exception. ErrorEventArgs^ myErrorEventArgs = gcnew ErrorEventArgs( myException ); //Extracts the exception from the ErrorEventArgs and display it. Exception^ myReturnedException = myErrorEventArgs->GetException(); MessageBox::Show( String::Concat( "The returned exception is: ", myReturnedException->Message ) ); }
public static void main(String[] args) { //Creates an exception with an error message. System.Exception myException = new System.Exception("This is an exception test"); //Creates an ErrorEventArgs with the exception. ErrorEventArgs myErrorEventArgs = new ErrorEventArgs(myException); //Extracts the exception from the ErrorEventArgs and display it. System.Exception myReturnedException = myErrorEventArgs.GetException(); MessageBox.Show("The returned exception is: " + myReturnedException.get_Message()); } //main

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からErrorEventArgs.GetException メソッドを検索する場合は、下記のリンクをクリックしてください。

- ErrorEventArgs.GetException メソッドのページへのリンク