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:

image

You still get the instance of the desired assembly; then you can iterate types (or modules if preferred). The Assembly.GetTypes method returns an array of System.Type objects defined in the assembly that you can iterate for detailed information. The System.Type class exposes several GetX methods, in which X can stand for Constructors, Properties, Methods, Fields, and ...

Get Visual Basic 2010 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.