System.Diagnostics.StackTrace ss = new System.Diagnostics.StackTrace(true); System.Reflection.MethodBase mb = ss.GetFrame(1).GetMethod(); System.Reflection.MethodBase mb1 = ss.GetFrame(0).GetMethod(); string m = mb.Name; string m1 = mb1.Name; WriteLog($"本方法:{m1}"); WriteLog($"父方法:{m}");