FieldBuilder.GetValue(Object) Method
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.
Retrieves the value of the field supported by the given object.
public:
override System::Object ^ GetValue(System::Object ^ obj);
public override object? GetValue (object? obj);
public override object GetValue (object obj);
override this.GetValue : obj -> obj
Public Overrides Function GetValue (obj As Object) As Object
- obj
- Object
The object on which to access the field.
An Object containing the value of the field reflected by this instance.
This method is not supported.
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. Before returning the value, GetValue checks to see if the user has access permission.
Access restrictions are ignored for fully-trusted code. Private
constructors, methods, fields, and properties can be accessed and invoked using Reflection whenever the code is fully-trusted.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: