Skip to sidebar Skip to content
Ipercube Technical
Jack of all trades, master of none
Date: Time: - Stardate:
Welcome, Log in by clicking  Here!
SS64
MDN
Stack
Code
GitHub
Wiki
Convert
V Studio
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions
Ipercube Technical
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions

Get .NET Type Kind

Returns the kind of a .NET type (e.g. Class, Module, Interface, Enum, Struct, Delegate).

VB
    Public Function GetTypeKind(assembly As Assembly, 
                                typeFullName As String) As String
        Try
            Dim t As Type = assembly.GetType(typeFullName, throwOnError:=False, ignoreCase:=True)
            If t Is Nothing Then Return "Unknown"

            ' Check for VB.NET Module
            If t.IsDefined(GetType(Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute), inherit:=False) Then
                Return "Module"
            End If

            If t.IsClass Then Return "Class"
            If t.IsInterface Then Return "Interface"
            If t.IsEnum Then Return "Enum"
            If t.IsValueType Then Return "Struct"
            If GetType([Delegate]).IsAssignableFrom(t.BaseType) Then Return "Delegate"

            Return "Unknown"
        Catch
            Return "Unknown"
        End Try
        
    End Function

Posted by ipercube


© 2026 Ipercube Design