MethodInfo mi typeof MainClass GetMethod Main MethodBody mb mi GetMeth

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
MethodInfo mi = typeof(MainClass).GetMethod("Main");
MethodBody mb = mi.GetMethodBody();
Console.WriteLine("\r\nMethod: {0}", mi);
Console.WriteLine(" Local variables are initialized: {0}", mb.InitLocals);
Console.WriteLine(" Maximum number of items on the operand stack: {0}", mb.MaxStackSize);
// Display information about the local variables in the
// method body.
Console.WriteLine();
foreach (LocalVariableInfo lvi in mb.LocalVariables)
{
lvi.
Console.WriteLine("Local variable: {0}", lvi);
}