See this code which executes a task after 5 seconds:
C#:
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Timer tmr = new Timer();
tmr.Interval = 5000;
tmr.Tick += new EventHandler(tmr_Tick);
tmr.Start();
}
void tmr_Tick(object sender, EventArgs e)
{
((Timer)sender).Stop();
}
}
}
VB.NET:
Namespace WindowsFormsApplication1
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
Dim tmr As New Timer()
tmr.Interval = 5000
tmr.Tick += New EventHandler(AddressOf tmr_Tick)
'Do some work
tmr.Start()
End Sub
Private Sub tmr_Tick(sender As Object, e As EventArgs)
'Do some work after 5 seconds
DirectCast(sender, Timer).[Stop]()
End Sub
End Class
End Namespace
Does that look very hard to you? Just use 8 hours instead of 5 seconds and you are done like:
tmr.Interval = 8*60*60*1000;