About Me

My photo
a Dynamic and Energetic guy.....

Thursday, July 24, 2008

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:

My Masters