【发布时间】:2009-08-21 14:05:38
【问题描述】:
.NET BCL 中是否有任何现有功能可以使用 MethodInfo 提供的信息在运行时打印方法的完整签名(如您在 Visual Studio ObjectBrowser 中看到的 - 包括参数名称)?
例如,如果您查找 String.Compare(),其中一个重载将打印为:
public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, System.Globalization.CultureInfo culture)
请注意包含所有访问和范围限定符的完整签名以及包括名称在内的完整参数列表。这就是我要找的。我可以编写自己的方法,但如果可能的话,我宁愿使用现有的实现。
【问题讨论】:
标签: c# .net debugging reflection