_FieldInfo.SetValueDirect(TypedReference, Object) 方法

定义

重要

此 API 不符合 CLS。

为 COM 对象提供对 SetValueDirect(TypedReference, Object) 方法的与版本无关的访问。Provides COM objects with version-independent access to the SetValueDirect(TypedReference, Object) method.

public:
 void SetValueDirect(TypedReference obj, System::Object ^ value);
[System.CLSCompliant(false)]
public void SetValueDirect (TypedReference obj, object value);
public void SetValueDirect (TypedReference obj, object value);
[<System.CLSCompliant(false)>]
abstract member SetValueDirect : TypedReference * obj -> unit
abstract member SetValueDirect : TypedReference * obj -> unit
Public Sub SetValueDirect (obj As TypedReference, value As Object)

参数

obj
TypedReference

将设置其字段值的对象。The object whose field value will be set.

value
Object

要分配给字段的值。The value to assign to the field.

属性

注解

此方法用于从非托管代码访问托管类,不应从托管代码调用。This method is for access to managed classes from unmanaged code, and should not be called from managed code.

SetValueDirect方法设置给定对象支持的字段的值。The SetValueDirect method sets the value of the field supported by the given object.

适用于