反射方法调用时:参数计数不匹配( parameter count mismatch )
2013-07-17 21:33 假面Wilson 阅读(2197) 评论(0) 收藏 举报Invoke方法的参数当中有一个自己的object[],正好你传递的参数也是object[],这样的话invoke就会把你参数数组里面的第一个参数作为参数传递给你要调用的方法,于是就报错了。
解决问题的如下:
postedParams = new object[] { postedParams };
StrinForBack = (string)currentMethod.Invoke(currentInstance, postedParams);
浙公网安备 33010602011771号