Export (0) Print
Expand All

MethodBody.GetILAsByteArray Method

Note: This method is new in the .NET Framework version 2.0.

Returns the MSIL for the method body, as an array of bytes.

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)

public byte[] GetILAsByteArray ()
public byte[] GetILAsByteArray ()
public function GetILAsByteArray () : byte[]

Return Value

An array of type Byte that contains the MSIL for the method body.

You can use the token-resolution methods of the module class, such as ResolveType, ResolveMethod, and ResolveType, to resolve the tokens in the method body to Type objects, MethodInfo objects, and FieldInfo objects that provide detailed information about the types, methods, and fields accessed by the MSIL in the method body.

NoteNote

Parsing method bodies requires a thorough understanding of metadata and MSIL instruction formats. Information can be found in the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". The documentation is available online at http://msdn.microsoft.com/net/ecma/ and http://www.ecma-international.org/publications/standards/Ecma-335.htm.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft