如果我有一个Object和它的Type,那么通过名称调用一些方法就像“Method1”一样?
我想做这样的事情:
Object o; Type t; // At this point I know,that 'o' actually has // 't' as it's type. // And I know that 't' definitely has a public method 'Method1'. // So,I want to do something like: Reflection.CallMethodByName(o,"Method1");
这有可能吗我确实意识到这会很慢,这是不方便的,但不幸的是,我没有其他方法来实现这一点.