Obtains the value of the field that is reflected by the current instance and contained in the specified object.
[Edit]
Parameters
- obj
- An object that contains the field value to be returned. If the field reflected by the current instance is static, obj is ignored. For non-static fields, obj is required to be an instance of a class that inherits or declares the field.
[Edit]
Returns
A object that contains the
value of the field reflected by the current instance.
[Edit]
Permissions
Exceptions
Type | Reason |
---|
NotSupportedException | A field is marked literal, but the field does not have one of the accepted literal types. Note: For information regarding the accepted literal types, see Partition II of the CLI Specification.
[Edit]
|
FieldAccessException | The field reflected by the current instance is non-public, and the caller does not have permission to access non-public members.
[Edit]
|
ArgumentException | The field reflected by the current instance is declared neither directly in obj nor in any class from which obj derives.
[Edit]
|
System.Reflection.TargetException | The field reflected by the current instance is non-static, and obj is null.
[Edit]
|
Remarks
Requirements
Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0