class Program {
        static void Main(string[] args) {
            test();
            run();
            Console.ReadKey();
        }

        static void run() {
            test();
        }

        static void test() {
            var method = new StackFrame(1).GetMethod();
            if (method.Name=="run")
            {
                Console.WriteLine("不允许被run调用");
            }
            else {
                Console.WriteLine("test成功");
            }
        }
    }

 

posted on 2013-12-11 17:56  深海大虾  阅读(466)  评论(0编辑  收藏  举报