How to use reflection to call method by name

后端 未结 4 1415
太阳男子
太阳男子 2020-11-28 13:46

Hi I am trying to use C# reflection to call a method that is passed a parameter and in return passes back a result. How can I do that? I\'ve tried a couple of things but wit

4条回答
  •  余生分开走
    2020-11-28 13:55

    Here's a quick example of calling an object method by name using reflection:

    Type thisType = .GetType();
    MethodInfo theMethod = thisType.GetMethod(); 
    theMethod.Invoke(this, ); 
    

提交回复
热议问题