_Assembly.GetType Method

Definition

Provides COM objects with version-independent access to the GetType methods.

Overloads

GetType(String, Boolean, Boolean)

Provides COM objects with version-independent access to the GetType(String, Boolean, Boolean) method.

GetType(String, Boolean)

Provides COM objects with version-independent access to the GetType(String, Boolean) method.

GetType()

Provides COM objects with version-independent access to the GetType() method.

GetType(String)

Provides COM objects with version-independent access to the GetType(String) method.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The GetType methods get the Type object that represents the specified type.

GetType(String, Boolean, Boolean)

Provides COM objects with version-independent access to the GetType(String, Boolean, Boolean) method.

C#
public Type GetType(string name, bool throwOnError, bool ignoreCase);

Parameters

name
String

The full name of the type.

throwOnError
Boolean

true to throw an exception if the type is not found; false to return null.

ignoreCase
Boolean

true to ignore the case of the type name; otherwise, false.

Returns

A Type object that represents the specified class.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The GetType method gets the Type object with the specified name in the assembly instance, with the options of ignoring the case, and of throwing an exception if the type is not found.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetType(String, Boolean)

Provides COM objects with version-independent access to the GetType(String, Boolean) method.

C#
public Type GetType(string name, bool throwOnError);

Parameters

name
String

The full name of the type.

throwOnError
Boolean

true to throw an exception if the type is not found; false to return null.

Returns

A Type object that represents the specified class.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The GetType method gets the Type object with the specified name in the assembly instance and optionally throws an exception if the type is not found.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetType()

Provides COM objects with version-independent access to the GetType() method.

C#
public Type GetType();

Returns

A Type object.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The GetType method gets the type of the current instance.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetType(String)

Provides COM objects with version-independent access to the GetType(String) method.

C#
public Type GetType(string name);

Parameters

name
String

The full name of the type.

Returns

A Type object that represents the specified class, or null if the class is not found.

Remarks

This method is for access to managed classes from unmanaged code, and should not be called from managed code.

The GetType method gets the Type object with the specified name in the assembly instance.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1