How to make a timer which forces the application to close at a specified time in C#? I have something like this:
void myTimer_Elapsed(object sender, System.
void myTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { if (DateTime.Now.Hour >= 23) { this.Close(); } }