如何使用Reflection枚举具有MethodAttributes.PrivateScope的方法?
答案 0 :(得分:1)
你试过了吗?
Type t = typeof(MyClass);
var Methods = t.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance);
foreach (MethodInfo mInfo in Methods)
{
if (mInfo.Attributes == MethodAttributes.PrivateScope))
{
// Do what needs to be done.
}
}