(Apr 10, 2015 09:34 AM)Coco_Cubana Wrote: public class Timer1
{
private static System.Timers.Timer aTimer;
public static void Main()
{
// Create a timer with a ten second interval.
aTimer = new System.Timers.Timer(600000);
// Hook up the Elapsed event for the timer.
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
// Set the Interval to x minutes
aTimer.Interval = 600000;
aTimer.Enabled = true;
Console.WriteLine("Press the Enter key to exit the program.");
Console.ReadLine();
// If the timer is declared in a long-running method, use
// KeepAlive to prevent garbage collection from occurring
// before the method ends.
GC.KeepAlive(aTimer);
}
// Specify what you want to happen when the Elapsed event is
// raised.
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
Butnupdate.Enabled = false;
MessageBox.Show("Time Up!");
}
}
example taken from microsoft
This is java code.
As the user above me said that's one of the ways to do it. Just stick that in a timer that checks every few seconds (or less if you wanted)
