C# 查看IL代码
https://blog.csdn.net/susan19890313/article/details/6949685
https://cloud.tencent.com/developer/article/1335491
https://docs.microsoft.com/en-us/dotnet/api/system.reflection.emit.opcodes?redirectedfrom=MSDN&view=netframework-4.8#fields
IL指令链接
第一种使用方式:
找到ildasm.exe工具:
打开要看的exe文件:
Ldloc——Loads the local variable at a specific index onto the evaluation stack.
Stloc——Pops the current value from the top of the evaluation stack and stores it in a the local variable list at a specified index.
st——store,loc——local
左边Student是class
右边Student是struct
class Student //如果是struct,则为上面的那个图
{
public int a;
}
class Program
{
static void Main(string[] args)
{
Student s = new Student();
List<Student> list = new List<Student>();
list.Add(s);
Console.ReadKey();
}
}