Check Process Status in C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • johnson.bruno

    #1

    Check Process Status in C#

    Hi,
    I want to check whether a process is running or not in a C# console
    application. Is there any method which will allow me to pass process name
    and get number of instances of it

    Thanks
    JBruno


  • Lebesgue

    #2
    Re: Check Process Status in C#

    public static Process[] GetProcessesByN ame(string processName);

    So,
    Process[] notepads =
    System.Diagnost ics.Process.Get ProcessesByName ("notepad.exe") ;
    int notepadCount = notepads.Length ;

    Source:
    http://msdn.microsoft.com/library/de...ExitTopic2.asp


    "johnson.br uno" <johnson_bruno@ hotmail.com> wrote in message
    news:%23qHJyaiU FHA.3056@TK2MSF TNGP14.phx.gbl. ..[color=blue]
    > Hi,
    > I want to check whether a process is running or not in a C# console
    > application. Is there any method which will allow me to pass process name
    > and get number of instances of it
    >
    > Thanks
    > JBruno
    >
    >[/color]


    Comment

    Working...