日期:2014-05-17 浏览次数:20423 次
static void Main(string[] args)
{
var list = GetList("ConsoleApplication1.Program");//命名空间+类名
Console.ReadLine();
}
static IList GetList(string str)
{
var genericTypeList = typeof(List<>).MakeGenericType(Type.GetType(str));
return Activator.CreateInstance(genericTypeList) as IList;
}