O'Reilly logo

Visual Basic 2010 Unleashed by Alessandro Del Sole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required