Hello,
I want to execute a function at 18:00 o'clock at everyday. I use timer function before and use for trigging functions but I havent try like this. Is there any simple function for this?
regards.
private void function(object sender, EventArgs e)
{
...
}
Loading
Sam HobbsPosted Sep 15, 2011, 10:42 PM
I don't understand why you can't use the task scheduler; as best as I understand what you need to do, the task scheduler was designed to do exactly what you need to do.
VulpesPosted Sep 15, 2011, 11:22 AM
private bool firstTime = true;
Now in Form_Load, set the timer's Interval property to the difference between 18:00 and the present time.
Finally, in the timer.Tick eventhandler, check if firstTime is true and, if it is, reset the Interval property to 24 hours and firstTime to false.
Alternatively, rather than the System.Windows.Forms.Timer you could use a System.Threading.Timer (see http://msdn.microsoft.com/en-us/library/2x96zfy7.aspx) which allows you to set the time to wait until the first callback as well as the period between successive callbacks.
yokzuPosted Sep 15, 2011, 5:05 AM
Is there another way?
Prabhu RajaPosted Sep 9, 2011, 2:49 AM
I found some thing like your requirement on net. Hope this will be Useful.
Try This Link
-------------------------------------------------
If this post helps you, then mark as "Correct Answer"