Getting parent class' name using Reflection

前端 未结 8 877
后悔当初
后悔当初 2020-12-03 16:30

How can I get the name of the parent class of some class using Reflection?

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 17:29

    You can use:

    string baseclassName = typeof(MyClass).BaseType.Name;
    

提交回复
热议问题