我想知道在c#中是否有一种方法来执行一个方法,如果我们在一个字符串中只有它的名字?
string methodname="method"
this.RunMethod(methodname)像这样的吗?
谢谢:)
发布于 2012-04-26 21:38:01
就像这样
Type type = GetType("MyType");
MethodInfo methodInfo = type.GetMethod(methodName);
methodInfo.Invoke()https://stackoverflow.com/questions/10334588
复制相似问题