1. 根据类型实例化对象
//Type tp;
object o = Activator.CreateInstance(tp);
view = o as View;
2.根据类名称的字符串实例化对象
//Type tp;
Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
object o3 = asm.CreateInstance(tp.ToString());
view = o3 as View;
1. 根据类型实例化对象
//Type tp;
object o = Activator.CreateInstance(tp);
view = o as View;
2.根据类名称的字符串实例化对象
//Type tp;
Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
object o3 = asm.CreateInstance(tp.ToString());
view = o3 as View;