111,119
社区成员
发帖
与我相关
我的任务
分享
Assembly asm = Assembly.LoadFile("程序集路径");
foreach (Type t in asm.GetTypes())
{
foreach (MethodInfo mi in t.GetMethods(BindingFlags.Static | BindingFlags.Public))
{
foreach (object obj in mi.GetCustomAttributes(false))
{
if (obj is DllImportAttribute)
Console.WriteLine(((DllImportAttribute)obj).Value);
}
}
}