StackTrace trace = new StackTrace();
            //获取是哪个类来调用的  
            Type type = trace.GetFrame(1).GetMethod().DeclaringType;
            //获取是类中的那个方法调用的  
            string method = trace.GetFrame(1).GetMethod().ToString();

 

相关文章: