Cheers cableguy looks like that should work, however I get the following error: Error 1 Program '....\ReadLines.exe' has more than one entry point defined: 'Timer1.Main()'. Compile with /main to specify the type that contains the entry point. .....\ReadLines\Timer.cs 8 24 ReadLines
I've run the timer in a htread and that did not help either.
public static System.Timers.Timer aTimer;
public void Form1_Load(object sender, EventArgs e)
Thread thread = new Thread(new ThreadStart(Timer));
public static void Timer()
// Create a timer with a three second interval.
aTimer = new System.Timers.Timer(3000);
// Hook up the Elapsed event for the timer.
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
// Set the Interval to 2 seconds (2000 milliseconds).
aTimer.Interval = 2000;
aTimer.Enabled = true;
I'm not the best C# coder as I hardly use it, so be gentle lol.