C#通过assembly打印公共实例方法
public void Coverage() { writeMethodStart("Coverage"); Assembly assembly = Assembly.LoadFrom("MyApplication.dll"); foreach(Module module in assembly.GetModules()) { write("loading module "+module); Type[] types = module.FindTypes(null,null); foreach(Type type in types) { write(" ** "+type); MemberInfo[] memberInfoArray = type.GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.DeclaredOnly); foreach(MemberInfo memberInfo in memberInfoArray) { write(" "+memberInfo.Name+"()"); } } }