Convert C# code to IL code
问题 How I can get IL code of C# code ? Can I do this with a extern library, or exists internal functions ? EDIT : I want to show IL code in my application with a MessageBox. 回答1: Programmatically? You can use reflection to get a MethodInfo , and then call MethodBase.GetMethodBody to get the body. From the MethodBody , you can call GetILAsByteArray amongst other things. Of course, if you just want to examine it yourself, there's Reflector, dotPeek, ildasm (part of the .NET SDK) and no doubt other