c# 获取当前正在执行的函数名称

string methodName=new StackTrace(new StackFrame(true))?.GetFrame(0)?.GetMethod()?.Name;

请务必将这行代码放在当前正在执行的函数 中~!

猜你喜欢

转载自blog.csdn.net/CsethCRM/article/details/106646523
今日推荐