Possible Duplicate:
Retrieving the calling method name from within a method (C#)
I have a class say A
in which there is a Method called Func1
; this function is static.
Now there are some other classes say B
, C
that use A.Func1
How can I get the class name which contains the function that is calling ?
ie
public class A
{
public static void Func1()
{
// who called me?
}
}
public class B
{
public void CallFunc()
{
A.Func1();
}
}
public class C
{
public void AlsoCallFunc()
{
A.Func1();
}
}