110,530
社区成员
发帖
与我相关
我的任务
分享
Assembly assembly = Assembly.Load("xxxxxx");
foreach (Type type in assembly.GetExportedTypes())
{
if (type.IsClass)
{
object[] attributes = type.GetCustomAttribute(typeof(MyAttribute), false);
if (attributes != null && attributes.Length > 0)
{
return Activator.CreateInstance(type);
}
}
}
return null;