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.
C° to F°: Celsius to Fahrenheit Conversion Formula To convert temperatures in degrees Celsius to Fahrenheit, multiply by 1.8 (or 9/5) and add 32.
Quick Celsius (°C) / Fahrenheit (°F) Conversion:°C.
How to Convert Temperatures. First, you need the formula for converting Fahrenheit (F) to Celsius (C): C = 5/9 x (F-32)
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 tools...
Use IL Disassembler like this:
c:\il>csc Class.cs
c:\il>ildasm /output=Class.il Class.exe
you'll both have the IL & the exe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With