How to run specific Code every Day Start=Time End=Time

midan1

Member
Joined
Dec 10, 2006
Messages
9
Programming Experience
Beginner
How to run specific Code every Day Start=Time End=Time
How to RUN in Windows Forms specific Code
like Scheduled
every day
Start Time=10:00 am
End Time= 16:00 PM
and after in
Start Time=18:00 PM
End Time= 23:59
But only Part of The Code !!!

TNX
 
Do you need it to run multiple times in the time period? Only once? Only when the user opens the form during that time period? Or what?

Why does it have to be in a windows form? Can you just create a service or console app and use windows scheduler?
 
no it must be windows form
and must run part of the code
every day
Start Time=10:00 am
End Time= 16:00 PM

STOP
and after in
every day
Start Time=18:00 PM
End Time= 23:59

STOP
every day.....
can you halp ??

TNX
 
I think that you can use what you are doing in your other question about timers to help here. If your form is continually running, just have the timer poll every 5 to 10 seconds and if you are in the desired time frame run the code else don't.
 
I don't have time to throw together an example closer to what you want, but I did find this with a quick google search. Very simpile example of starting and stoping a timer and how to handle event when the timer fires.

http://abstractvb.com/code.asp?A=1032

When the event fires in the example just just check the current time and if in the defined time period do your code.
 
Back
Top