FieldInfo.GetValueDirect(TypedReference) 方法

定义

重要

此 API 不符合 CLS。

符合 CLS 的替代方案
System.Reflection.FieldInfo.GetValue(Object)

返回给定对象所支持的字段的值。Returns the value of a field supported by a given object.

public:
 virtual System::Object ^ GetValueDirect(TypedReference obj);
[System.CLSCompliant(false)]
public virtual object? GetValueDirect (TypedReference obj);
[System.CLSCompliant(false)]
public virtual object GetValueDirect (TypedReference obj);
[<System.CLSCompliant(false)>]
abstract member GetValueDirect : TypedReference -> obj
override this.GetValueDirect : TypedReference -> obj
abstract member GetValueDirect : TypedReference -> obj
override this.GetValueDirect : TypedReference -> obj
Public Overridable Function GetValueDirect (obj As TypedReference) As Object

参数

obj
TypedReference

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.

返回

Object

包含字段值的 ObjectAn Object containing a field value.

实现

属性

例外

调用方需要公共语言规范 (CLS) 的替代项,但改为调用此方法。The caller requires the Common Language Specification (CLS) alternative, but called this method instead.

适用于