Sdílet prostřednictvím


IReflect.GetField Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns the FieldInfo object that corresponds to the specified field and binding flag.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Function GetField ( _
    name As String, _
    bindingAttr As BindingFlags _
) As FieldInfo
FieldInfo GetField(
    string name,
    BindingFlags bindingAttr
)

Parameters

Return Value

Type: System.Reflection.FieldInfo
A 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.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.