RuntimeReflectionExtensions.GetRuntimeField(Type, String) RuntimeReflectionExtensions.GetRuntimeField(Type, String) RuntimeReflectionExtensions.GetRuntimeField(Type, String) Method

定義

擷取表示指定之欄位的物件。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 Type Type

包含欄位的型別。The type that contains the field.

name
String String 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.

適用於

另請參閱