_Exception.GetBaseException 方法

定義

為 COM 物件提供與版本無關的 GetBaseException() 方法之存取權。Provides COM objects with version-independent access to the GetBaseException() method.

public:
 Exception ^ GetBaseException();
public Exception GetBaseException ();
abstract member GetBaseException : unit -> Exception
Public Function GetBaseException () As Exception

傳回

Exception

例外狀況鏈中擲回的第一個例外狀況。The first exception thrown in a chain of exceptions. 如果目前的例外狀況的 InnerException 屬性為 null 參考 (在 Visual Basic 中為 Nothing),則這個屬性會傳回目前的例外狀況。If the InnerException property of the current exception is a null reference (Nothing in Visual Basic), this property returns the current exception.

備註

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

Exception.GetBaseException方法 Exception 會傳回一或多個後續例外狀況的根本原因。The Exception.GetBaseException method returns the Exception that is the root cause of one or more subsequent exceptions.

適用於

另請參閱