namaspace BLL.UI_View
{
  public class FT_YearJerque_List : System.Windows.Forms.UserControl
  {
     public FT_YearJerque_List(System.Windows.Forms.Form frm, string [] qxList)
     {
        InitializeComponent();
        this.CreateForm();//创建窗体方法
     }
  }
}
--------------------------上面是Bll.Dll动态库中的构造方法System.Reflection.Assembly a = System.Reflection.Assembly.LoadFrom(Application.StartupPath+"\\BLL.DLL");System.Type t = a.GetType("BLL.UI_View.FT_YearJerque_List",false,true);object theObj = System.Activator.CreateInstance(t);System.Type[] paramTypes = new System.Type[2];
paramTypes[0] = System.Type.GetType("System.Windows.Forms.Form");
paramTypes[1] = System.Type.GetType("System.Array");System.Reflection.MethodInfo mi = t.GetMethod("FT_YearJerque_List",paramTypes);object[] parameters = new object[2];
parameters[0] = this;
parameters[1] = BLL.UI_View.FT_GroupPurview.qxList;

Object returnValue = mi.Invoke(theObj,parameters);请教高手 这样写对吗?  怎么会报types参数名的值不能为空啊

解决方案 »

  1.   

    http://www.cnblogs.com/jillzhang/archive/2006/08/10/473326.html
      

  2.   

    System.Type t = a.GetType("BLL.UI_View.FT_YearJerque_List",false,true);
    object[] parameters = new object[2];
    parameters[0] = this;
    parameters[1] = BLL.UI_View.FT_GroupPurview.qxList;
    Object returnValue =  System.Activator.CreateInstance(t,parameters);
      

  3.   

    ref:
    http://blog.csdn.net/knight94/archive/2006/04/10/657527.aspx