MayureshP
MayureshP

Reputation: 2634

scheduler for Web-application

I will be writing a Windows Service which will give a call to a class of my Web Application periodically. What are the possible ways of achieving it.

Upvotes: 0

Views: 486

Answers (3)

brendan
brendan

Reputation: 29996

Something similar to this,using a timer:

protected override void OnStart(string[] args)
{ 
        var timer = new System.Timers.Timer();
        timer.Elapsed += new ElapsedEventHandler(DoSomething);
        //do something every 30 seconds
        timer.Interval = TimeSpan.FromSeconds(30).TotalMilliseconds; 
        timer.Start();
}

private void DoSomething(object sender, ElapsedEventArgs e)
{
    //Do your timed event here...
}

Upvotes: 1

Jethro
Jethro

Reputation: 5916

Have a look at Quartz.NET.

"Quartz.NET is a full-featured, open source job scheduling system that can be used from smallest apps to large scale enterprise systems."

I've use it when ever I need scheduling of some type.

Upvotes: 0

nathan gonzalez
nathan gonzalez

Reputation: 12017

a timer?

Upvotes: 0

Related Questions