Call methods using names in C#

前端 未结 5 2026
梦谈多话
梦谈多话 2020-12-05 07:52

I have a number of \'jobs\' in my application, where each job has a list of methods which it needs to call, along with it\'s parameters. Essentially a list containing the fo

5条回答
  •  误落风尘
    2020-12-05 08:33

    If you're using .NET Framework 4, look at dynamic, otherwise GetMethod and then call Invoke of MethodInfo.

提交回复
热议问题