111,092
社区成员




class A
{
public static void Call()
{
B.OnlyA();
}
}
class B
{
public static void OnlyA()
{
System.Diagnostics.StackFrame sf = new StackFrame(1);
if (sf.GetMethod().DeclaringType == typeof(A))
MessageBox.Show("OK,You are A");
}
}