Try this and put the IvrApplication.Start in the OnTimed Event
One question... Are you sure that code you are running is not an Application users interact with?
//In OnStart
System.Timers.Timer aTimer = new System.Timers.Timer(500); //500 MilliSeconds
// Hook up the Elapsed event for the timer.
aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
// Set the Interval to 2 seconds (2000 milliseconds).
//aTimer.Interval = 600000; //10 minutes //2000; //2 seconds (2000 mili seconds)
aTimer.AutoReset = false;
aTimer.Enabled = true;
//Console.WriteLine("Press the Enter key to exit the program.");
//Console.ReadLine();
// Keep the timer alive until the end of Main. This allows OnStart to close in a timely manor.
GC.KeepAlive(aTimer);
}
// Specify what you want to happen when the Elapsed event is
// raised.
private static void OnTimedEvent(object source, ElapsedEventArgs e)
{
IvrApplication.Start();
}
One question... Are you sure that code you are running is not an Application users interact with?
No comments:
Post a Comment