111,098
社区成员




foreach (string file in Directory.GetFiles(Environment.CurrentDirectory,"*.dll"))
{
try
{
foreach (Type type in Assembly.LoadFile(file).GetTypes())
{
Type[] interfaces = type.GetInterfaces();
bool find = false;
foreach (var parent in interfaces)
{
if(!parent.IsGenericType)continue;
var definition = parent.GetGenericTypeDefinition();
if (definition == typeof (ITestModule<,>))
{
MessageBox.Show(type.GetMethod("ToString").Invoke(Activator.CreateInstance(type), Type.EmptyTypes).ToString());
find = true;
break;
}
}
if(find)
break;
}
}
catch (Exception)
{
}
}