反射根据类名动态生成对象

public T CreateObj<T>(string className) where T:class
{
Type type = Type.GetType(className);
return Activator.CreateInstance(type) as T;
}
原文地址:https://www.cnblogs.com/xiaoahui/p/13703227.html