VB.NET: Get class name of a instance

afe picture afe · Aug 20, 2010 · Viewed 34.6k times · Source

Is there a way to get the instance's class name with VB.NET?

Answer

Kelsey picture Kelsey · Aug 20, 2010
Dim type As Type = yourObject.GetType()
Dim typeName As String = type.FullName

Full name will get you the fully qualified name of the Type, including the namespace of the Type.

See MSDN for more information on what is available with Type.