System.Reflection.FieldInfo Class

Discovers the attributes of a field and provides access to field metadata.

See Also: FieldInfo Members

Syntax

[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComDefaultInterface(typeof(System.Runtime.InteropServices._FieldInfo))]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class FieldInfo : MemberInfo, System.Runtime.InteropServices._FieldInfo

Remarks

The field information is obtained from metadata. The System.Reflection.FieldInfo class does not have a public constructor. System.Reflection.FieldInfo objects are obtained by calling either the Type.GetFields or Type.GetField(string, BindingFlags) method of a Type object.

Fields are variables defined in the class. System.Reflection.FieldInfo provides access to the metadata for a field within a class and provides dynamic set and get functionality for the field. The class is not loaded into memory until invoke or get is called on the object.

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Permissions

TypeReason
!:

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0