Retrieves the FieldInfo object corresponding to a specified field.
[Visual Basic] Function GetField( _ ByVal name As String, _ ByVal bindingAttr As BindingFlags _ ) As FieldInfo [C#] FieldInfo GetField( string name, BindingFlags bindingAttr ); [C++] FieldInfo* GetField( String* name, BindingFlags bindingAttr ) = 0; [JScript] function GetField( name : String, bindingAttr : BindingFlags ) : FieldInfo;
A FieldInfo object containing the field information for the named object.
Exception Type | Condition |
---|---|
AmbiguousMatchException | if the object implements multiple fields with the same name. |
The GetField method retrieves the FieldInfo object using the name and binding attributes parameters. The match is based upon the name of the field.
An example of a binding attribute value is IgnoreCase.
IReflect Interface | IReflect Members | System.Reflection Namespace | String | BindingFlags