ErrorEventArgs.GetException メソッドとは? わかりやすく解説

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

ErrorEventArgs.GetException メソッド

発生したエラーを表す Exception取得します

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

Public Overridable Function
 GetException As Exception
Dim instance As ErrorEventArgs
Dim returnValue As Exception

returnValue = instance.GetException
public:
virtual Exception^ GetException ()
public Exception 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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

ErrorEventArgs.GetException メソッドのお隣キーワード
検索ランキング

   

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



ErrorEventArgs.GetException メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS