System.Reflection.Module.GetField Method

Returns a field having the specified name and binding attributes.

Syntax

public virtual FieldInfo GetField (string name, BindingFlags bindingAttr)

Parameters

name
The field name.
bindingAttr
One of the BindingFlags bit flags used to control the search.

Returns

A FieldInfo object having the specified name and binding attributes, or null if the field does not exist.

Exceptions

TypeReason
ArgumentNullException name is null.

Remarks

Note: A global field is a field with a module-level scope.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0