_Assembly.GetType 方法

定義

為 COM 物件提供與版本無關的 GetType 方法之存取權。

多載

GetType(String, Boolean, Boolean)

為 COM 物件提供與版本無關的 GetType(String, Boolean, Boolean) 方法之存取權。

GetType(String, Boolean)

為 COM 物件提供與版本無關的 GetType(String, Boolean) 方法之存取權。

GetType()

為 COM 物件提供與版本無關的 GetType() 方法之存取權。

GetType(String)

為 COM 物件提供與版本無關的 GetType(String) 方法之存取權。

備註

此方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法 GetType 會取得 Type 代表指定型別的 物件。

GetType(String, Boolean, Boolean)

為 COM 物件提供與版本無關的 GetType(String, Boolean, Boolean) 方法之存取權。

public:
 Type ^ GetType(System::String ^ name, bool throwOnError, bool ignoreCase);
public Type GetType (string name, bool throwOnError, bool ignoreCase);
abstract member GetType : string * bool * bool -> Type
Public Function GetType (name As String, throwOnError As Boolean, ignoreCase As Boolean) As Type

參數

name
String

類型的完整名稱。

throwOnError
Boolean

true 表示找不到該類型時擲回例外狀況,false 則表示傳回 null

ignoreCase
Boolean

若要忽略類型名稱的大小寫,則為 true,否則為 false

傳回

表示指定類別的 Type 物件。

備註

此方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法 GetType 會取得 Type 元件實例中具有指定名稱的物件、忽略大小寫的選項,以及在找不到類型時擲回例外狀況。

另請參閱

適用於

GetType(String, Boolean)

為 COM 物件提供與版本無關的 GetType(String, Boolean) 方法之存取權。

public:
 Type ^ GetType(System::String ^ name, bool throwOnError);
public Type GetType (string name, bool throwOnError);
abstract member GetType : string * bool -> Type
Public Function GetType (name As String, throwOnError As Boolean) As Type

參數

name
String

類型的完整名稱。

throwOnError
Boolean

true 表示找不到該類型時擲回例外狀況,false 則表示傳回 null

傳回

表示指定類別的 Type 物件。

備註

此方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法 GetType 會取得 Type 元件實例中具有指定名稱的物件,並在找不到類型時選擇性地擲回例外狀況。

另請參閱

適用於

GetType()

為 COM 物件提供與版本無關的 GetType() 方法之存取權。

public:
 Type ^ GetType();
public Type GetType ();
abstract member GetType : unit -> Type
Public Function GetType () As Type

傳回

Type 物件。

備註

此方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法 GetType 會取得目前實例的類型。

另請參閱

適用於

GetType(String)

為 COM 物件提供與版本無關的 GetType(String) 方法之存取權。

public:
 Type ^ GetType(System::String ^ name);
public Type GetType (string name);
abstract member GetType : string -> Type
Public Function GetType (name As String) As Type

參數

name
String

類型的完整名稱。

傳回

Type 物件,表示指定的類別;如果找不到類別,則為 null

備註

此方法適用于從 Unmanaged 程式碼存取 Managed 類別,不應從 Managed 程式碼呼叫。

方法 GetType 會取得 Type 元件實例中具有指定名稱的物件。

另請參閱

適用於