I need to write a program for a web site that allways runs once a day. My idea is to use a snipped according t the supplied code below. I know this code is stupid and will block the site - but an idea along those lines. My question is - is this the best approach and how do I make sure that this code always is alive. What if I want this task to start running before any visits to the site has occured - how is that done? If I want the task to allways run at a specific time each day - how is that done? The site is hosted at an ISP and my access to the web server is very limited.
protected void Page_Load(object sender, EventArgs e)
//do other things ...
protected void ScheduledTask()
//Do the stuff
Thread.Sleep(86400000); //sleep 24 hours