• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

Scheduling events??

Hello everyone..
I want to be able to schedule my program to send emails on every monday,wednesday and friday....

I dont wanna know how to send emails or how to do the whole thing...I SIMPLY WANNA KNOW HOW TO SCHEDULE EVENTS...WITHOUT USING TIMER!!

Thanks :)
0
godwindotnet
Asked:
godwindotnet
1 Solution
 
bruintjeCommented:
Hello godwindotnet,

not sure if it is an option but you could run your app on the windows scheduler which is great for that sort of thing

hope this helps a bit
bruintje
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
If you don't want to use a Timer then use the System.Threading.Thread.Sleep() function.  Calculate the time interval needed to your next "event" in milliseconds and the put your app to sleep for that duration.  When it wakes up it will be the correct time.  If you have a GUI then hide your app first as it will unresponsive during the Sleep interval.  Or you could create a Class that encapsulates a Thread.  Make the encapsulated thread sleep and when it wakes up raise an event from your Class to notify the main UI.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now