Get inherited caller type name in base static class

前端 未结 2 1505
暗喜
暗喜 2021-01-20 12:06

i have:

class parent
{
    public static string GetTypeName()
    { 
        /* here i want to get the caller\'s type
        So child.GetTypeName() should d         


        
2条回答
  •  情书的邮戳
    2021-01-20 12:14

    I believe this.GetType() will do this. But can't check at the moment.

    (assuming you want the child's type in the parent's method.)

提交回复
热议问题