Type trypInfo = typeof(Program);// Program为类名
//获得方法名
string str = "包括的方法名列表:\r\n";
 MethodInfo[] methodInfo = trypInfo.GetMethods();
 foreach (MethodInfo mInfo in methodInfo)
 {
       str += mInfo.ToString() + "\r\n";
}

 

注:需要引用

using System.Reflection;

相关文章: