private string[] getMethodList(System.Type myType)
{
int i,l;
MethodInfo myMethodInfo;
MethodInfo[] myArrayMethodInfo = myType.GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.DeclaredOnly);
l = myArrayMethodInfo.Length;
string[] methodList=new string[l];
for(i=0;i<myArrayMethodInfo.Length;i++)
{
myMethodInfo = (MethodInfo)myArrayMethodInfo[i];
methodList[i] = myMethodInfo.Name ;
}
return methodList;
}
获取一个类的方法列表C#
80酷酷网 80kuku.com