代码如下:

namespace x{
public class A{
   public string sayHello(){
    
/*
   
classs B
的实例调用class A的这个方法时
    
如何在此处获取classs B的实例的句柄并
    classs B
的实例的方法Add()进行调用
  */
    return "hello evey one";
  }
}
}

namespace y{
using x;
public class B{
  int _n;
   public int n{
     get{return _n;}
     set{_n=value;}
   }  
  public int Add(){
       return ++n;
  }
 static void Main(){
  A a=new A();
  string xx=a.sayHello();
 }

}

}

哪位兄弟知道,请指点一二

用事件实现如下

  1被调用者如何在运行时得到调用者对象的句柄?using System;
  2被调用者如何在运行时得到调用者对象的句柄?using System.Drawing;
  3被调用者如何在运行时得到调用者对象的句柄?using System.Collections;
  4被调用者如何在运行时得到调用者对象的句柄?using System.ComponentModel;
  5被调用者如何在运行时得到调用者对象的句柄?using System.Windows.Forms;
  6被调用者如何在运行时得到调用者对象的句柄?using System.Data;
  7被调用者如何在运行时得到调用者对象的句柄?using log4net;
  8被调用者如何在运行时得到调用者对象的句柄?using System.Reflection;
  9被调用者如何在运行时得到调用者对象的句柄?
 10被调用者如何在运行时得到调用者对象的句柄?namespace WY.RisingSun.WMS.UI
 11


 1被调用者如何在运行时得到调用者对象的句柄?using System;
 2被调用者如何在运行时得到调用者对象的句柄?using System.Collections;
 3被调用者如何在运行时得到调用者对象的句柄?using System.ComponentModel;
 4被调用者如何在运行时得到调用者对象的句柄?using System.Drawing;
 5被调用者如何在运行时得到调用者对象的句柄?using System.Windows.Forms;
 6被调用者如何在运行时得到调用者对象的句柄?
 7被调用者如何在运行时得到调用者对象的句柄?namespace WY.RisingSun.WMS.UI
 8


 1被调用者如何在运行时得到调用者对象的句柄?using System;
 2被调用者如何在运行时得到调用者对象的句柄?using System.Collections;
 3被调用者如何在运行时得到调用者对象的句柄?using System.ComponentModel;
 4被调用者如何在运行时得到调用者对象的句柄?using System.Drawing;
 5被调用者如何在运行时得到调用者对象的句柄?using System.Windows.Forms;
 6被调用者如何在运行时得到调用者对象的句柄?
 7被调用者如何在运行时得到调用者对象的句柄?namespace WY.RisingSun.WMS.UI
 8

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2022-02-19
  • 2022-12-23
  • 2022-02-04
  • 2021-08-29
猜你喜欢
  • 2022-12-23
  • 2022-01-09
  • 2022-01-30
  • 2022-12-23
  • 2022-02-05
  • 2021-12-29
  • 2022-02-02
相关资源
相似解决方案