Exception クラス

定義

アプリケーションの実行中に発生したエラーを表します。

public ref class Exception
public ref class Exception : System::Runtime::Serialization::ISerializable
public ref class Exception : System::Runtime::InteropServices::_Exception, System::Runtime::Serialization::ISerializable
public class Exception
public class Exception : System.Runtime.Serialization.ISerializable
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)]
[System.Serializable]
public class Exception : System.Runtime.Serialization.ISerializable
[System.Serializable]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public class Exception : System.Runtime.InteropServices._Exception, System.Runtime.Serialization.ISerializable
type Exception = class
type Exception = class
    interface ISerializable
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)>]
[<System.Serializable>]
type Exception = class
    interface ISerializable
[<System.Serializable>]
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Exception = class
    interface ISerializable
    interface _Exception
Public Class Exception
Public Class Exception
Implements ISerializable
Public Class Exception
Implements _Exception, ISerializable
継承
Exception
派生
属性
実装

注釈

この API の詳細については、「 例外に関する補足 API 解説」を参照してください。

コンストラクター

Exception()

Exception クラスの新しいインスタンスを初期化します。

Exception(SerializationInfo, StreamingContext)
古い.

シリアル化したデータを使用して、Exception クラスの新しいインスタンスを初期化します。

Exception(String)

指定したエラー メッセージを使用して、Exception クラスの新しいインスタンスを初期化します。

Exception(String, Exception)

指定したエラー メッセージおよびこの例外の原因となった内部例外への参照を使用して、Exception クラスの新しいインスタンスを初期化します。

プロパティ

Data

例外に関する追加のユーザー定義情報を提供する、キーと値のペアのコレクションを取得します。

HelpLink

この例外に関連付けられているヘルプ ファイルへのリンクを取得または設定します。

HResult

特定の例外に割り当てられているコード化数値である HRESULT を取得または設定します。

InnerException

現在の例外の原因となる Exception インスタンスを取得します。

Message

現在の例外を説明するメッセージを取得します。

Source

エラーの原因となるアプリケーションまたはオブジェクトの名前を取得または設定します。

StackTrace

呼び出し履歴で直前のフレームの文字列形式を取得します。

TargetSite

現在の例外がスローされたメソッドを取得します。

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetBaseException()

派生クラスでオーバーライドされた場合、それ以後に発生する 1 つ以上の例外の根本原因である Exception を返します。

GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetObjectData(SerializationInfo, StreamingContext)
古い.

派生クラスでオーバーライドされた場合は、その例外に関する情報を使用して SerializationInfo を設定します。

GetType()

現在のインスタンスのランタイム型を取得します。

GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在の例外の文字列形式を作成して返します。

イベント

SerializeObjectState
古い.

例外がシリアル化され、例外に関するシリアル化されたデータを含む例外状態オブジェクトが作成されたときに発生します。

適用対象

こちらもご覧ください