MemberInfo.Name gets the name of the current member.
Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic
Class Mymemberinfo
Public Shared Function Main() As Integer
Dim MyType As Type = Type.GetType("System.Empty")
Dim Mymemberinfoarray As MemberInfo() = MyType.GetMembers()
Console.WriteLine("There are {0} members in {1}", Mymemberinfoarray.GetLength(0), MyType.FullName)
Dim Mymemberinfo As MemberInfo
For Each Mymemberinfo In Mymemberinfoarray
Console.WriteLine(Mymemberinfo.Name & " declaring type - " & Mymemberinfo.DeclaringType.ToString())
Next Mymemberinfo
Return 0
End Function
End Class
Related examples in the same category