Assembly.LoadFrom("assemblyName").GetTypes();
Assembly.Load("assemblyName").GetTypes();
遍历, 再通过Type.GetInterface("```"),如果结果不为null,那就说明找到了
再Activator.CreateInstance(“”)即可
还是写段代码吧:
foreach(Type t in Assembly.Load("MyAssemblyName").GetTypes())
{
if(t.GetInterface("IYourInterface")!=null)
{
IYourInterface=(IYourInterface)Activator.CreateInstance(t);
````
}
}
hoho就这样
(类型)Assembly.Load(路径).CreateInstance(类名);