有人能告诉我如何使用C#反射找到类实现的所有接口吗?
就像找到实现特定接口的所有类一样
if(type.getInterface(typeof(IAuto)) != null)
{
console.writeline(type.name.tostring());
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
105 次 |
| 最近记录: |