Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FieldInfo::GetValueDirect Method (TypedReference)

 
clsCompliantAlternativeM:System.Reflection.FieldInfo.GetValue(System.Object)

Returns the value of a field supported by a given object.

This API is not CLS-compliant.

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

public:
[CLSCompliantAttribute(false)]
virtual Object^ GetValueDirect(
	TypedReference obj
)

Parameters

obj
Type: System::TypedReference

A TypedReference structure that encapsulates a managed pointer to a location and a runtime representation of the type that might be stored at that location.

Return Value

Type: System::Object^

An Object containing a field value.

Exception Condition
NotSupportedException

The caller requires the Common Language Specification (CLS) alternative, but called this method instead.

ReflectionPermission

for accessing non-public fields when the grant set of the non-public members is restricted to the caller's grant set, or a subset thereof. Associated enumeration: ReflectionPermissionFlag::RestrictedMemberAccess

ReflectionPermission

for accessing non-public fields regardless of their grant set. Associated enumeration: ReflectionPermissionFlag::MemberAccess

ReflectionPermission

when invoked late-bound through mechanisms such as Type::InvokeMember. Associated enumeration: ReflectionPermissionFlag::MemberAccess.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft