_Exception.InnerException 屬性

定義

為 COM 物件提供與版本無關的 InnerException 屬性之存取權。Provides COM objects with version-independent access to the InnerException property.

public:
 property Exception ^ InnerException { Exception ^ get(); };
public Exception InnerException { get; }
member this.InnerException : Exception
Public ReadOnly Property InnerException As Exception

屬性值

Exception

Exception 的執行個體,描述造成目前例外狀況的錯誤。An instance of Exception that describes the error that caused the current exception. InnerException 屬性會傳回與傳遞到建構函式相同的值,但如果沒有提供內部例外狀況值給建構函式,則會傳回 Null 參考 (在 Visual Basic 中為 Nothing)。The InnerException property returns the same value that was passed to the constructor, or a null reference (Nothing in Visual Basic) if the inner exception value was not supplied to the constructor. 這個屬性是唯讀的。This property is read-only.

備註

這個方法是用來從非受控程式碼存取 managed 類別,而且不應該從 managed 程式碼呼叫。This method is for access to managed classes from unmanaged code and should not be called from managed code.

Exception.InnerException屬性 Exception 會取得造成目前例外狀況的實例。The Exception.InnerException property gets the Exception instance that caused the current exception.

適用於

另請參閱