Module.GetField Method  
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a specified field.
Overloads
| GetField(String) | Returns a field having the specified name. | 
| GetField(String, BindingFlags) | Returns a field having the specified name and binding attributes. | 
GetField(String)
- Source:
- Module.cs
- Source:
- Module.cs
- Source:
- Module.cs
- Source:
- Module.cs
Returns a field having the specified name.
public:
 System::Reflection::FieldInfo ^ GetField(System::String ^ name);[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Fields might be removed")]
public System.Reflection.FieldInfo? GetField(string name);public System.Reflection.FieldInfo GetField(string name);public System.Reflection.FieldInfo? GetField(string name);[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Fields might be removed")>]
member this.GetField : string -> System.Reflection.FieldInfomember this.GetField : string -> System.Reflection.FieldInfoPublic Function GetField (name As String) As FieldInfoParameters
- name
- String
The field name.
Returns
A FieldInfo object having the specified name, or null if the field does not exist.
- Attributes
Exceptions
The name parameter is null.
Applies to
GetField(String, BindingFlags)
- Source:
- Module.cs
- Source:
- Module.cs
- Source:
- Module.cs
- Source:
- Module.cs
Returns a field having the specified name and binding attributes.
public:
 virtual System::Reflection::FieldInfo ^ GetField(System::String ^ name, System::Reflection::BindingFlags bindingAttr);public:
 System::Reflection::FieldInfo ^ GetField(System::String ^ name, System::Reflection::BindingFlags bindingAttr);[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Fields might be removed")]
public virtual System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr);public virtual System.Reflection.FieldInfo GetField(string name, System.Reflection.BindingFlags bindingAttr);public virtual System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr);public System.Reflection.FieldInfo GetField(string name, System.Reflection.BindingFlags bindingAttr);[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Fields might be removed")>]
abstract member GetField : string * System.Reflection.BindingFlags -> System.Reflection.FieldInfo
override this.GetField : string * System.Reflection.BindingFlags -> System.Reflection.FieldInfoabstract member GetField : string * System.Reflection.BindingFlags -> System.Reflection.FieldInfo
override this.GetField : string * System.Reflection.BindingFlags -> System.Reflection.FieldInfomember this.GetField : string * System.Reflection.BindingFlags -> System.Reflection.FieldInfoPublic Overridable Function GetField (name As String, bindingAttr As BindingFlags) As FieldInfoPublic Function GetField (name As String, bindingAttr As BindingFlags) As FieldInfoParameters
- name
- String
The field name.
- bindingAttr
- BindingFlags
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.
- Attributes
Exceptions
The name parameter is null.