Get Calling Method

Settembre 21st, 2007

Description: Retrieves the fully qualified name of the calling method.

Link: http://www.codekeep.net/snippets/3f718583-7ff8-49c1-bfcf-2ff271119436.aspx

System.Reflection.MethodBase methodBase =
	(new System.Diagnostics.StackFrame(2, false)).GetMethod();
Console.WriteLine(methodBase.ReflectedType.FullName + "." + methodBase.Name);

  • .NET
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.