我创建了一个 MethodInfo 实例:
MethodInfo theMethod = typeof(Reciever).GetMethod("methodName", parameterTypes);
现在我想知道方法的返回类型是否为空。怎么办?
最佳答案
简单:
theMethod.ReturnType == typeof(void)
关于C# 方法信息 getReturnType,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1013443/