Checking if certain processes are running, on a certain machine

  • Thread starter Thread starter Paul Aspinall
  • Start date Start date
P

Paul Aspinall

Hi
I want to write a piece of code, that will check if a particular service is
running on a particular machine.
Can someone give me a pointer as to which classes would be useful??
Any sample code would be appreciated

Thanks
 
Hello Paul,

Just a point (u don't have codesnippet)
http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=43569&DisplayTab=Article

U need to use Performance counters

PA> Hi
PA> I want to write a piece of code, that will check if a particular
PA> service is
PA> running on a particular machine.
PA> Can someone give me a pointer as to which classes would be useful??
PA> Any sample code would be appreciated
PA> Thanks
PA>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Salam

you cannot get the information about the process running on the remoate PC,
but for that you must have an admin rights

Process[] arrProcess;

arrProcess=Process.GetProcesses(/* C REMOTE COMPUTER NAME*/);

foreach (Process p in arrProcess)

{

if (p.ProcessName==/* REQUIRED PROCESS NAME*/)

{

// do something

}

}


--
ALI RAZA SHAIKH
MCAD.net

www.programmersparadise.cjb.net
alirazashaikh.blogspot.com
 
Salam

you cannot get the information about the process running on the remoate PC,
but for that you must have an admin rights

Process[] arrProcess;

arrProcess=Process.GetProcesses(/* C REMOTE COMPUTER NAME*/);

foreach (Process p in arrProcess)

{

if (p.ProcessName==/* REQUIRED PROCESS NAME*/)

{

// do something

}

}


--
ALI RAZA SHAIKH
MCAD.net

www.programmersparadise.cjb.net
alirazashaikh.blogspot.com
 
Back
Top