System.Diagnostics.StackTrace lobjStack = new System.Diagnostics.StackTrace();
//Get the immediate caller
System.Diagnostics.StackFrame lobjCaller = lobjStack.GetFrame(1);
System.Reflection.MethodBase lobjMethodBase = lobjCaller.GetMethod();
string lstrCallingModule = lobjMethodBase.ReflectedType.FullName;
return lstrCallingModule; // this will return the name of the class
// you can use this to get function name also
No comments:
Post a Comment