我有:
class parent
{
public static string GetTypeName()
{
/* here i want to get the caller's type
So child.GetTypeName() should display "child" */
}
}
class child : parent { }
static void Main()
{
Console.WriteLine(child.GetTypeName());
}
Run Code Online (Sandbox Code Playgroud)
有可能以某种方式在基类中获取调用者的类型吗?