对于接口A,如何知道哪(些)个类实现了接口A

解决方案 »

  1.   

    第一,肯定能找到继承此接口的类的,你看清楚查找的结果,应该有classa:Ia的记录
    第二,既然能找到使用次接口的函数,那逆向查找也能找到最终new 的继承此接口的方法。
      

  2.   

    第二,既然能找到使用次接口的函数,那逆向查找也能找到最终new 的继承此接口的类。
      

  3.   


    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (105, 41) : MessageBox.Show(oWordApplic.Documents.GetType().Name);
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (124, 32) : oDoc = oWordApplic.Documents.Open(ref fileName, ref missing, ref missing, ref missing,
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (139, 23) : oDoc = oWordApplic.Documents.Add(ref missing, ref missing,ref missing, ref missing);
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (650, 32) : oDoc = oWordApplic.Documents.Add(ref fileName, ref oMissing,
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (684, 32) : oDoc = oWordApplic.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (707, 32) : oDoc = oWordApplic.Documents.Add(ref oMissing, ref oMissing, ref oMissing, ref oMissing);
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (727, 32) : oDoc = oWordApplic.Documents.Add(ref oMissing, ref oMissing,
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (750, 32) : oDoc = oWordApplic.Documents.Add(ref oMissing, ref oMissing,
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (775, 32) : oDoc = oWordApplic.Documents.Add(ref oMissing, ref oMissing,
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (813, 32) : oDoc = oWordApplic.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
    D:\[Csharp]\[Csharp练习]\ldyh\练习\ldyhWordApp.cs - (99, 32) : oDoc = oWordApplic.Documents.Open(ref fileName, ref missing, ref missing, ref missing,
    D:\[Csharp]\[Csharp练习]\ldyh\练习\wordapp2.cs - (164, 78) : Microsoft.Office.Interop.Word.Document wordDoc = oWordApplic.Documents.Open(ref filename, ref ConfirmConversions,
    D:\[Csharp]\[Csharp练习]\ldyh\练习\wordapp2.cs - (63, 32) : oDoc = oWordApplic.Documents.Open(ref fileName, ref missing, ref readOnly,
    D:\[Csharp]\[Csharp练习]\ldyh\练习\wordapp2.cs - (75, 32) : oDoc = oWordApplic.Documents.Add(ref missing, ref missing, ref missing, ref missing);这是所有引用,请您看看哪个类实现了Documents接口。
      

  4.   

    接口Documents是Microsoft.Office.Interop.Word.ApplicationClass oWordApplic的一个属性ApplicationClass 实现了_Application 接口,这没有错。
      

  5.   

    从你的结果来看,Documents是一个属性呢,你应该先转到Documents的类型上,在做我说的那个步骤
    然后,你使用的office的组件吧,这个又不是你自己写的,当然不能查找接口的引用了。因为你的代码有没有去实现它,你可以把这个组件的代码reflector后,把源代码down成一个项目再去查就能查到了。
      

  6.   


    先生,如何做reflector呢?教教我,谢谢!
      

  7.   

    呵呵,你到google里查下Reflector.exe,很多地方有下载的。