Activator根
System名称空间中的类非常强大。
将参数传递给构造函数等的重载很多。在以下位置查看文档:
http://msdn.microsoft.com/zh-
CN/library/system.activator.createinstance.aspx
或(新路径)
https://docs.microsoft.com/zh-
cn/dotnet/api/system.activator.createinstance
以下是一些简单的示例:
ObjectType instance = (ObjectType)Activator.CreateInstance(objectType);ObjectType instance = (ObjectType)Activator.CreateInstance("MyAssembly","MyNamespace.ObjectType");


