I know in C# you can call a function from a string by doing so
Type thisType = this.GetType();
MethodInfo theMethod = thisType.GetMethod(TheCommandString);
theMethod.Invoke(this, userParameters);
But I would like something like this
CallMethodFromName("Console.WriteLine", "Hello, world!");
How do I call a function from another namespace using reflection ?
Aucun commentaire:
Enregistrer un commentaire