110,499
社区成员
发帖
与我相关
我的任务
分享
System.Diagnostics.StackTrace trace = new System.Diagnostics.StackTrace();
System.Diagnostics.StackFrame frame = trace.GetFrame(1);
System.Reflection.MethodBase method = frame.GetMethod();
string methodName = method.Name; // 获取方法名
string typeName = method.DeclaringType.Name; // 获取所在类名称