1 #region 根据对象名成创建对象 2 ///3 /// 根据对象名成创建对象 4 /// 5 /// 程序集名称 6 /// 类全称,包括命名空间 7 ///对象的实例 8 public object Create(string assemblyName, string classFullName) 9 {10 if (string.IsNullOrEmpty(classFullName) || string.IsNullOrEmpty(assemblyName)) return null;11 var type = Type.GetType(classFullName + "," + assemblyName);12 return type == null ? null : Activator.CreateInstance(type);13 }14 #endregion