call class method using a string name
By Super Man
call class method using a string name
using System.Reflection;
classdemo c1 = new classdemo();
// call function1
MethodInfo mi = typeof(classdemo).GetMethod("functionname_in_string_format");
// here function1 doesn't take any argument that's what we pass null
mi.Invoke(c1, null);
call class method using a string name (452 Views)