Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Detect whether a process has started running

I like to ask also if i can make use of the system.diagnostics namespace to detect if an application has started running or it does not exist at all.

Thanks a lot

G_Zola
Monday, May 09, 2005

How many times do we have to answer this? Do you even read the answers posted here? I also see your exact same questions out on Gotdotnet. If you simply spent 1/10th the time looking at the documentation as you do posting these questions all over the place, you would have your answers much faster (and actually learn something).

One more time... System.Diagnostics.Process.

If I have offended you then I apologize. But you do not appear to care about the fact that some of us use our valuable time to help others in need. When people take advantage of that it makes us not want to help people any more.

Google my friend, Google...

matt
Monday, May 09, 2005

==> Google my friend, Google...

I'm usually a bit more "in your face" about it:

http://www.fuckinggoogleit.com/

Sgt.Sausage
Monday, May 09, 2005

Sorry please don't get angry. I know system.diagnostics.process namespace can detect the status of the process.Just need to know if i can use the length property to determine if an application has been run or is there another standard way to do it..........

Below is my code:

Process[] procs;

procs=Process.GetProcessesByName("testreplication","capia1");
                
if(procs.Length!=0){
    
if(procs[0].Responding==true)
{
Console.WriteLine("Responding");
}
else
{
Console.WriteLine("Not Responding");
}
}
else
{
Console.WriteLine("Process has not started");
}

G_Zola
Tuesday, May 10, 2005

Your code is completely incoherent and syntatically incorrect.

Tharsan
Tuesday, May 17, 2005

> Your code is completely incoherent and syntatically incorrect.
Incoherent is subjective, but it's syntactically correct C#.
And will display information about processes named "testreplication" running on machine "capia1".

Joe
Tuesday, May 17, 2005

*  Recent Topics

*  Fog Creek Home