using System.Activator;Type t = Type.GetType("ClassA /*命名空间,版本等...*/");
ClassA aa =(ClassA)Activator.CreateInstance(t);

解决方案 »

  1.   

    See Activator class:
     
    http://msdn.microsoft.com/library/default.asp?url=/library/en-
    us/cpref/html/frlrfSystemActivatorClassCreateInstanceTopic.asp
      

  2.   


    Type t = Type.GetType(yourNameSpace+className);
        MessageBox.Show(t.ToString());
    object dObj = Activator.CreateInstance(t);
    Type[] tp=new Type[0];
    MethodInfo method = t.GetMethod("ShowDialog",tp);
    BindingFlags flag = BindingFlags.Public | BindingFlags.Instance;
    object returnValue = method.Invoke(dObj,flag,Type.DefaultBinder,null,null);
      

  3.   

    写错了方法的名字,看下面的
    Type t = Type.GetType(yourNameSpace+className);
    object dObj = Activator.CreateInstance(t);
    Type[] tp=new Type[0];
    MethodInfo method = t.GetMethod("ClassA",tp);
    BindingFlags flag = BindingFlags.Public | BindingFlags.Instance;
    object returnValue = method.Invoke(dObj,flag,Type.DefaultBinder,null,null);