反射获取类的公有成员方法
using System.Reflection;
ReflectClass r = new ReflectClass();
Type type = r.GetType();

//获取公有成员方法
MethodInfo[] methodInfo = type.GetMethods();
foreach (MethodInfo m in methodInfo) {
    Console.Write(m.Name + " ");
}

Type类的GetMethods方法获取类的相关公有成员方法的信息。


首页 我的博客
粤ICP备17103704号