vendredi 13 mars 2015

Create instance of class and call method from string


String ClassName = "MyClass"
String MethodName = "MyMethod"


I would like to achieve:



var class = new MyClass;
MyClass.MyMethod();


I saw some e.g. with reflection , but they only show , either having a method name as string or class name as string, any help appreciated.






Aucun commentaire:

Enregistrer un commentaire