获知哪个函数调用了本函数及它的类名
StackTrace st = new StackTrace(); StackFrame callerFrame = st.GetFrame(2); string callerInfo = callerFrame.GetMethod().DeclaringType.Name + "." + callerFrame.GetMethod().Name + "()";