c#如何通过反射实现指定类名的实例

解决方案 »

  1.   

    Type  type = typeof("类名");
    type.没分!! 还基础! 累人了!
      

  2.   

    求助:
    Type  type = typeof(frmKoumokuKensaku);
    Form frm = (Form)type.Assembly.CreateInstance("frmKoumokuKensaku");
    我通过上面语句,为什么frm是null,好像没有被实例化?
      

  3.   

    为什么要用这种方法实例化,不能直接new 吗
    菜鸟问题````请多指教,谢过先``
      

  4.   

    改成这种方式应该好用,你试下哈
    Type  type = typeof(frmKoumokuKensaku);
    string strFullName= type.FullName;
    Form frm = (Form)type.Assembly.CreateInstance(strFullName);