RuntimeReflectionExtensions.GetRuntimeField(Type, String) 方法

定义

检索表示指定字段的对象。Retrieves an object that represents a specified field.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Reflection::FieldInfo ^ GetRuntimeField(Type ^ type, System::String ^ name);
public static System.Reflection.FieldInfo GetRuntimeField (this Type type, string name);
static member GetRuntimeField : Type * string -> System.Reflection.FieldInfo

参数

type
Type

包含字段的类型。The type that contains the field.

name
String

字段的名称。The name of the field.

返回

表示指定字段的对象,若未找到该字段则为 nullAn object that represents the specified field, or null if the field is not found.

异常

typenulltype is null.

-or-

namenullname is null.

适用于

另请参阅