看基类被那几个类继承了
using System; using System.Reflection; using System.Linq; public class BaseClass { } public class DerivedClass1 : BaseClass { } public class DerivedClass2 : BaseClass { } class Program { static void Main() { Type baseType = typeof(BaseClass); Assembly assembly = Assembly.GetExecutingAssembly(); var derivedTypes = assembly.GetTypes() .Where(t => t.IsSubclassOf(baseType)); foreach (var type in derivedTypes) { Console.WriteLine(type.Name); } } }