C# 如何使用反射枚举具有MethodAttributes.PrivateScope的方法?
如何使用反射枚举具有MethodAttributes.PrivateScope的方法?您是否尝试过:C# 如何使用反射枚举具有MethodAttributes.PrivateScope的方法?,c#,.net,reflection,C#,.net,Reflection,如何使用反射枚举具有MethodAttributes.PrivateScope的方法?您是否尝试过: Type t = typeof(MyClass); var Methods = t.GetMethods(BindingFlags.NonPublic | BindingFlags.Instance); foreach (MethodInfo mInfo in Methods) { if (mInfo.Attributes == MethodAttributes.PrivateScop
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.
}
}