Is there a way to get an array of the arguments passed to a method?

后端 未结 9 1334
小蘑菇
小蘑菇 2020-12-05 18:17

Say I have a method:

 public void SomeMethod(String p1, String p2, int p3)
 {

 #if DEBUG
    object[] args = GetArguments();
    LogParamaters(args);
 #endi         


        
9条回答
  •  鱼传尺愫
    2020-12-05 18:27

    Sure can ...check out this post, it gets the actual values of the params. how to enumerate passed method parameters

提交回复
热议问题