知道类名,怎么用这个类名实例化一个对象
string ClassName= "Model.Uaer ";//传入的参数
怎么根据ClassName实例化一个对象
ClassName obj=new ClassName();
------解决方案--------------------用反射
------解决方案--------------------using System.Reflection;
private void button1_Click(object sender, EventArgs e)
{
Assembly vAssembly = Assembly.GetExecutingAssembly();
object vTemp = vAssembly.CreateInstance( "WindowsApplication1.Form1 ");
((Form)vTemp).Show();
}