Hi,
Here is a piece of code that does that, I use the config file to store the
app path, args and interval
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
private void Form1_Load(object sender, System.EventArgs e)
{
//setup the timer
int interval = Convert.ToInt32(
System.Configuration.ConfigurationSettings.AppSett ings["Interval"]) *
1000 *
(
System.Configuration.ConfigurationSettings.AppSett ings["MinutesORSeconds"].ToLower()=="m"?60:1
);
this.timer1.Interval = interval;
this.timer1.Tick+=new EventHandler(timer1_Tick);
timer1.Enabled = true;
timer1_Tick( null, null);
}
private void timer1_Tick(object sender, EventArgs e)
{
timer1.Stop();
//Restart the process
ProcessStartInfo si = new ProcessStartInfo();
si.FileName =
System.Configuration.ConfigurationSettings.AppSett ings["path_to_exe"] ;
si.WindowStyle = ProcessWindowStyle.Hidden;
//Set the other parameter
if ( this.currentIndex == this.list.Count )
currentIndex = 0;
si.Arguments =
System.Configuration.ConfigurationSettings.AppSett ings["args_to_exe"]+ " " +
list[currentIndex].ToString();
currentIndex++;
theRunningProcess = Process.Start( si );
timer1.Start();
}
"Eranga" <km***@yahoo.com> wrote in message
news:O9*************@TK2MSFTNGP14.phx.gbl...
Hello All,
I need to run one program from another within time slots specified by
the user. Could some one please tell me how this could be achieved?
The program that should be run is created in C#, I would prefer to make
the other one also in C# please help me with this!!1
Thanks in advance
*** Sent via Developersdex http://www.developersdex.com ***