Returns the
FieldInfo object that corresponds to the specified field and binding flag.
Namespace: System.ReflectionAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax FieldInfo GetField(
string name,
BindingFlags bindingAttr
)
Parameters
- name
- Type: SystemString
The name of the field to find. - bindingAttr
- Type: System.ReflectionBindingFlags
The binding attributes used to control the search.
Return Value
Type:
FieldInfoA
FieldInfo object containing the field information for the named object that meets the search constraints specified in
bindingAttr.
Exceptions Exception | Condition |
---|
AmbiguousMatchException | The object implements multiple fields with the same name. |
See Also