Question Callback at interval:

faifuhi

New member
Joined
Jan 21, 2009
Messages
2
Programming Experience
3-5
Hi,

I'm developing an application which basically connects to a device, read the data stored in that device and store the information to the database. I'm using .net 2.0 (visual studio 2005) with Visual Basic.

I have programmed the data reading from the device and writing them to the database. However, now I have to make sure that this data read from the device takes place at an interval, like every 10 seconds (10000 milliseconds).

I'm able to do this in a Windows Application, but i'm wondering how do i go about implementing it in a console Application.

Any directions or suggestions?

Thanks for your time.

aHa
 
It's done in basically the same way. You just use a Timers.Timer and handle its Elapsed event instead of the Tick event of a Windows.Forms.Timer. Just note that, unlike the Tick event, the Elapsed event will only be raised once by default. If you want it to be raised continually you must set the Timer's AutoReset property to True.
 
Back
Top