繁体   English   中英

C#MethodInfo getReturnType

[英]C# MethodInfo getReturnType

我创建了一个MethodInfo的实例:

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

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

简单:

theMethod.ReturnType == typeof(void)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM