object obj = System.Activator.CreateInstance(Type.GetType("Antu.Metadata.FunctionAttributeService));
Type type = obj.GetType();
//获取实例中的指定方法
MethodInfo methodInfo = type.GetMethod("GetConstants");
//执行方法并返回执行结果
object o = methodInfo.Invoke(obj, null);
动态创建对象
最新推荐文章于 2023-09-14 18:07:27 发布