版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/huaxiyuan/article/details/52677889
静态:
命名空间+类:System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName
命名空间:System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Namespace
类:System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name
方法:new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name
非静态:
命名空间:this.GetType().ToString()
类:this.GetType().Name
方法:new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name