July 2015
Intermediate to advanced
1300 pages
87h 27m
English
Content preview from Visual Basic 2015 Unleashed
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
Start your free trial


Reflecting Types
Reflection enables retrieving information on programs, including modules, types, and type members defined within an assembly. For example, you might want to enumerate all types and type members defined in the People.dll assembly. Take a look at the following code:
Dim asm = Assembly.LoadFrom("People.dll")Console.WriteLine("Enumerating types:")For Each t In asm.GetTypes Console.WriteLine("Type name: {0}", t.ToString) Console.WriteLine(" Constructors:") For Each constructor In t.GetConstructors Console.WriteLine(" " + constructor.ToString) Next Console.WriteLine(" Methods:") For Each method In t.GetMethods Console.WriteLine(" " + method.ToString) Next Console.WriteLine(" ...