using Quartz;
using Quartz.Impl;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace QuartZ
{
class Program
{
static void Main(string[] args)
{
//加载程序集(dll文件地址),使用Assembly类
Assembly assembly = Assembly.LoadFile(@"D:\ConsoleSample\QuartZ\ClassLib\bin\Debug\ClassLib.dll");
//获取类型,参数(名称空间+类)
Type type = assembly.GetType("ClassLib.Sample");
//创建该对象的实例,object类型,参数(名称空间+类)
object instance = assembly.CreateInstance("ClassLib.Sample");
//设置Show_Str方法中的参数类型,Type[]类型;如有多个参数可以追加多个
Type[] params_type = new Type[1];
params_type[0] = Type.GetType("System.String");
C#反射动态调用dll中的方法及使用QuartZ.net实现作业调度
最新推荐文章于 2022-11-22 11:03:28 发布