call function using string Name

By j Miracle

Here i will show how you can call function by specifying string function name.

           MethodInfo mi = typeof(class1).GetMethod("functionnameHere");

             mi.Invoke(null, null);

             //if function takes argument then

             mi.Invoke(null, new object[] { "args1", "args2" });

call function using string Name  (1029 Views)