My question will probably sound stupid, but please bear in mind I don't know much about programming.
I managed to make a simple program with a timer. When you run it, it waits for 8 hours and then runs an .exe file in the same folder and then it closes itself.
The code is:
namespace Timer
{
public partial class Timer : Form
{
public Timer()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
System.Diagnostics.Process.Start(@"Alarm.exe");
System.Windows.Forms.Application.Exit();
}
}
}
I would like to change it so that when the timer runs out, it checks the time and only runs the .exe and closes itself if it's 8am or later. If it's not 8am yet, it should wait and run the .exe and close itself at 8am. Is there any easy way to accomplish this?
Thank you very much for your help.