获知哪一个函数调用了本函数及它的类名

 

获知哪一个函数调用了本函数及它的类名函数

StackTrace st = new StackTrace();
StackFrame callerFrame = st.GetFrame(2);
string callerInfo = callerFrame.GetMethod().DeclaringType.Name + "." + callerFrame.GetMethod().Name + "()";string

相关文章
相关标签/搜索