Used along with the System.Runtime.InteropServices.StructLayoutAttribute.LayoutKind set to Explicit to indicate he physical position of each field within a class.
Object
Attribute
FieldOffsetAttribute
[Visual Basic] Public Class FieldOffsetAttribute Inherits Attribute [C#] public class FieldOffsetAttribute : Attribute [C++] public __gc class FieldOffsetAttribute : public Attribute [JScript] public class FieldOffsetAttribute extends Attribute
[To be supplied.]
Namespace: System.Runtime.InteropServices
Assembly: mscorlib.dll
[C#]
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode), Pack=4] public struct TypeDesc { public int lpValue; public WORD vt; } [StructLayout(Layout.Explicit)] public class SYSTEM_INFO { [FieldOffset(0)] ulong OemId; [FieldOffset(4)] ulong PageSize; [FieldOffset(16)] ulong ActiveProcessorMask; [FieldOffset(20)] ulong NumberOfProcessors; [FieldOffset(24)] ulong ProcessorType; }
FieldOffsetAttribute Members | System.Runtime.InteropServices Namespace