Exceptions

Remarks

Members include properties, methods, fields, events, and so on.

This method searches the current classes and its base classes. If the requested type is non-public and the caller does not have ReflectionPermission to reflect non-public objects outside the current assembly, this method returns a null reference (Nothing in Visual Basic).

The following BindingFlags filter flags can be used to define which members to include in the search:

You must specify either BindingFlags.Instance or BindingFlags.Static in order to get a return.

Specify BindingFlags.Public to include public members in the search.

Specify BindingFlags.NonPublic to include non-public members (that is, private and protected members) in the search.

Specify BindingFlags.FlattenHierarchy to include static members up the hierarchy.

The following BindingFlags modifier flags can be used to change how the search works:

BindingFlags.IgnoreCase to ignore the case of name.

BindingFlags.DeclaredOnly to search only the members declared on the Type, not members that were simply inherited.