相关疑难解决方法(0)

如何获取装配中的所有基本类型?

所以,如果我有一个实例

System.Reflection.Assembly 
Run Code Online (Sandbox Code Playgroud)

我有以下型号:

class Person {}
class Student : Person {}
class Freshman : Student {}
class Employee : Person {}
class PersonList : ArrayList {}
class StudentList : PersonList {}
Run Code Online (Sandbox Code Playgroud)

如何枚举程序集的类型以仅获取对Person和PersonList类型的引用?

要明确:我不希望在此查找期间显式指定Person或PersonList类型.Person和PersonList只是本例中有问题的程序集中定义的根类型.我正在寻找一种枚举给定程序集的所有根类型的通用方法.

谢谢你的时间:)

.net c# reflection

1
推荐指数
1
解决办法
768
查看次数

标签 统计

.net ×1

c# ×1

reflection ×1