A simple ASP.NET task scheduler.
To create a task, simply create a class that implements IScheduledTask.
publicclassGenericTask:IScheduledTask{publicvoidDoWork(){// do something}}To initialize the task (which is usually done when the application starts), invoke the scheduler with an instance of a schedule (you can use a default schedule, or create a schedule of your own).
publicclassGlobal:System.Web.HttpApplication{protectedvoidApplication_Start(objectsender,EventArgse){Scheduler.Schedule<GenericTask>(newDaily(3,30,"Eastern Standard Time"));}}To create a new schedule, create a class that implements ISchedule.
publicclassInterval:ISchedule{privatelong_seconds;publicInterval(longseconds){_seconds=seconds;}publicDateTimeGetUtcExpirationDate(){returnDateTime.UtcNow.AddSeconds(_seconds);}}