1、加载dll
Assembly ass = Assembly.LoadFile(dllPath);
2、取public的方法Type
Type[] types = ass.GetExportedTypes();
3、继承接口Ixx
types = type.Where(p=>typeof(Ixx).IsAssignableFrom(type));
4、创建实例
Ixx xx = (Ixx)Activator.CreateInstance(type);
时间: 2024-10-29 03:29:51