ModuleBuilder.GetFields(BindingFlags) 方法
定义
返回在可移植可执行 (PE) 文件的 .sdata 区域中定义的、与指定绑定标志匹配的所有字段。Returns all fields defined in the .sdata region of the portable executable (PE) file that match the specified binding flags.
public:
override cli::array <System::Reflection::FieldInfo ^> ^ GetFields(System::Reflection::BindingFlags bindingFlags);
public override System.Reflection.FieldInfo[] GetFields (System.Reflection.BindingFlags bindingFlags);
override this.GetFields : System.Reflection.BindingFlags -> System.Reflection.FieldInfo[]
Public Overrides Function GetFields (bindingFlags As BindingFlags) As FieldInfo()
参数
- bindingFlags
- BindingFlags
用于控制搜索的 BindingFlags 位标志的组合。A combination of the BindingFlags bit flags used to control the search.
返回
与指定标志匹配的字段的数组;如果不存在这样的字段,则数组为空。An array of fields that match the specified flags; the array is empty if no such fields exist.
例外
name 参数为 null。The name parameter is null.
注解
发出动态程序集时,可移植可执行文件的 .sdata 区域中的字段 (PE) 文件是使用 DefineInitializedData 或方法定义的。 DefineUninitializedDataWhen you emit dynamic assemblies, fields in the .sdata region of the portable executable (PE) file are defined by using the DefineInitializedData or DefineUninitializedData methods.
重要
只有在为模块调用了方法之后,才能检索到模块级字段 CreateGlobalFunctions 。Module-level fields cannot be retrieved until after the CreateGlobalFunctions method has been called for the module.