i want my website(C#) will call async every 15 min to some c# function how can i do that?
thanks
You can use a static Timer and start it from the Application_Start() method in Global.asax.
Within Global.asax, add the following field:
static Timer _timer = null;
Then you can make your Application_Start() like:
void Application_Start(object sender, EventArgs e)
{
if (_timer == null)
{
_timer = new Timer();
_timer.Interval = 1000; // some interval
_timer.Elapsed += new ElapsedEventHandler(SomeStaticMethod);
_timer.Start();
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With