Partager via


FieldBuilder.GetValue Method

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

Retrieves the value of the field supported by the given object.

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

Syntax

'Declaration
Public Overrides Function GetValue ( _
    obj As Object _
) As Object
public override Object GetValue(
    Object obj
)

Parameters

  • obj
    Type: System.Object
    The object on which to access the field.

Return Value

Type: System.Object
An Object containing the value of the field reflected by this instance.

Exceptions

Exception Condition
NotSupportedException

This method is not supported.

Remarks

If the field is static, the obj parameter is ignored. For non-static fields, obj should be an instance of a class that inherits or declares the field.

The return type of GetValue is Object. For example, if the field holds a Boolean primitive value, an instance of Object with the appropriate Boolean value is returned.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

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