Timed Interval Coding

  • Thread starter Thread starter Slonocode
  • Start date Start date
S

Slonocode

I need to perform some updates such as retrieving a web page every 1 hour
or so. Is the timer control approriate for this kind of thing? Are there
other ways to do something like this?

Thanks
Slonocode
 
A timer control can do it, but if your process takes a while, you probably
won't like the results. Sounds like a great job for a background thread or
the System.Threading.Timer (as opposed to the timer control)
 
* "Slonocode said:
I need to perform some updates such as retrieving a web page every 1 hour
or so. Is the timer control approriate for this kind of thing? Are there
other ways to do something like this?

Did you read the documentation for:
'System.Windows.Forms.Timer'
'System.Threading.Timer'
'System.Timers.Timer'
?
 
Slonocode,
In addition to the others comments, do you want your programming always
running? Does your program do other things when it is not updating?

I would consider using a Scheduled Task under Windows Control Panel to
schedule the job to run every hour. Especially if the update only takes 1 or
2 minutes...

Alternatively I would look at using System.Threading.Timer or
System.Timers.Timer in a Windows Service Project, and let the update app run
continuously, performing the update on each timer event...

Hope this helps
Jay
 
Jay B. Harlow said:
Slonocode,
In addition to the others comments, do you want your programming always
running? Does your program do other things when it is not updating?

I would consider using a Scheduled Task under Windows Control Panel to
schedule the job to run every hour. Especially if the update only takes 1 or
2 minutes...

Alternatively I would look at using System.Threading.Timer or
System.Timers.Timer in a Windows Service Project, and let the update app run
continuously, performing the update on each timer event...

Hope this helps
Jay

I knew I should have included more info in my original post.:-)

It's basically a desktop application that may or may not run all all the
time. That would be up to the user.

It displays data obtained from a url. The data from the url is in xml
format. If the application is running all the time then it needs to update
itself at a specific interval.

I will investigate the timer classes suggested above.

Thanks
Slonocode
 
Back
Top