Share via


GetValue Method

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

When overridden in a derived class, returns the value of a field supported by a given object.

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

Syntax

'Declaration
Public MustOverride Function GetValue ( _
    obj As Object _
) As Object
public abstract Object GetValue(
    Object obj
)
public:
virtual Object^ GetValue(
    Object^ obj
) abstract
abstract GetValue : 
        obj:Object -> Object 
public abstract function GetValue(
    obj : Object
) : Object

Parameters

Return Value

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

Remarks

If the field is static, obj is ignored. For non-static fields, obj should be an instance of a class that inherits or declares the field. Note that 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. Before returning the value, GetValue checks to see if the user has access permission.

.NET Framework Security

See Also

Reference

FieldInfo Class

System.Reflection Namespace