How to read a method body with reflection

前端 未结 2 2141
囚心锁ツ
囚心锁ツ 2021-02-20 17:33

Is it possible to find out anything about a Method body with reflection?

How?

2条回答
  •  鱼传尺愫
    2021-02-20 18:35

    You can use MethodInfo.GetMethodBody.

    That provides you access to anything you want... if you're happy to work through the IL etc yourself.

    It's possible that the Mono Cecil library will provide more help - I haven't used it myself.

提交回复
热议问题