C#.NET反射获取Form窗体中所有的方法Method
C#.NET反射获取Form窗体中所有的方法Method
C# 全选
var type = this.GetType();
var list = this.GetType().GetMethods(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
.ToList().Where(w => w.DeclaringType == type).OrderBy(o => o.Name).ToList();
foreach (var method in list)
{
if (method.Name.ToUpper() == methodName.ToUpper())
{
method.Invoke(this, null);
return;
}
}
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网