How can I get fields used in a method (.NET)?

前端 未结 5 1047
名媛妹妹
名媛妹妹 2020-12-16 06:45

In .NET, using reflection how can I get class variables that are used in a method?

Ex:

class A
{
    UltraClass B = new(..);
    SupaClass C = new(..         


        
5条回答
  •  被撕碎了的回忆
    2020-12-16 07:23

    Reflection is primarily an API for inspecting metadata. What you're trying to do is inspect raw IL which is not a supported function of reflection. Reflection just returns IL as a raw byte[] which must be manually inspected.

提交回复
热议问题