摘要:
using System;using System.Collections.Generic;using System.Text;using APlusEmail.Quartz.EmailJob;using APlusEmail.Model;namespace APlusEmail.Quartz.Timer{ public class TimerManager { System.Timers.Timer t = new System.Timers.Timer(10000); //实例化Timer类,设置间隔时间为10000毫秒; public Timer... 阅读全文
摘要:
在多线程或单线程任务中,让线程带传入参数一直是个麻烦的问题,通常有种方法就是以类,对像的变量来传参数,这种方法理解上很简单不过在某些场合使用很麻烦,这里就不介绍了,我们主要介绍一种.NET2.0中新增加的带参数运行线程的方法,示例程序如下:ParameterizedThreadStart ParStart = new ParameterizedThreadStart(ThreadMethod);Thread myThread = new Thread(ParStart);object o = “hello”;myThread.Start(o);ThreadMethod如下:public voi 阅读全文