完全限定名的话,能。最简单的方法Type type = Type.GetType(Myclass);
object instance = Activator.CreateInstance(type);

解决方案 »

  1.   

    Type type = Type.GetType(Myclass);
    System.Reflection.ConstructorInfo mc_cnt_info=type.GetConstructor();
    Object obj=mc_cnt_info.Invoke();
      

  2.   

    我也想要![email protected]
    Thank u!
      

  3.   

    Type type = Type.GetType(类名字符串);
    object instance = Activator.CreateInstance(type);
      

  4.   

    Type.GetType(类名字符串)
    类名字符串 应该是 名称空间.类名
      

  5.   

    再up(如何实例化一个Form?)
      

  6.   

    '在同一个工程中,添加两个Form,然后在其中一个Form中显示另外一个
    System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
    Form f = (Form)assembly.CreateInstance("winApp_cs.Form2");
    f.ShowDialog();
      

  7.   

    Assembly ass = Assembly.LoadFrom(@"E:\MainHR.DAL.SQL.dll");
    Type t = ass.GetType("MainHR.DAL.SQL.SQLDB");
    ConstructorInfo conInfo = t.GetConstructor(Type.EmptyTypes);
    this.aSQLDB = (MainHR.Common.IDataBase)conInfo.Invoke(null);
      

  8.   

    兄弟给我来一份 谢谢!
    [email protected]