Software Development Network>> .NET Development>> running another process
I run an exe using
Process.Start("myexe.exe");
how can i check if the process is running so i dont run it twice
Thank You
there ar a couple of ways.
Process
if (theProcesses.Length > 1)
{
//more than 1 process is running
}
you could also get the process by ID which is returned by the Process.Start() method, returns a process object.
Process theProc = Process.Start("filename.exe");
...
if (!theProc.HasExited)
//....
I believe its the first one you are after, hopefully
running another process
shakalama
there ar a couple of ways.
Process
if (theProcesses.Length > 1)
{
//more than 1 process is running
}
you could also get the process by ID which is returned by the Process.Start() method, returns a process object.
Process theProc = Process.Start("filename.exe");
...
...
if (!theProc.HasExited)
{
//....
}
I believe its the first one you are after, hopefully