C#MethodInfo getReturnType

时间:2009-06-18 15:39:34

标签: c# .net reflection void methodinfo

我创建了一个MethodInfo的实例:

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

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

1 个答案:

答案 0 :(得分:11)

易:

theMethod.ReturnType == typeof(void)