I have a method:
add(int x,int y)
I also have:
int a = 5;
int b = 6;
string s = \"add\";
Is it poss
@Richard's answer is great. Just to expand it a bit:
This can be useful in a situation where you dynamically created an object of unknown type and need to call its method:
var do = xs.Deserialize(new XmlTextReader(ms)); // example - XML deserialization
do.GetType().GetMethod("myMethodName").Invoke(do, new [] {arg1, arg2});
becasue at compile time do
is just an Object
.