Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要获取返回类型为 void 的方法,类似于以下内容:
构造函数。
财产。
我该如何做类似的事情来告诉我返回类型为 void 的方法?
我怀疑你想调用Type.GetMethods,它返回所有方法的信息,然后在methodInfo.ReturnType == typeof(void) 处查找结果。
http://msdn.microsoft.com/en-us/library/4d848zkb(v=vs.110).aspx