我创建了一个MethodInfo的实例:

MethodInfo theMethod = typeof(Reciever).GetMethod("methodName", parameterTypes);

现在我想知道theMethod的返回类型是否为void。怎么样?

有帮助吗?

解决方案

易:

theMethod.ReturnType == typeof(void)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top