Monitoring multiple processes with the same name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dwayne2700
    New Member
    • Mar 2010
    • 3

    Monitoring multiple processes with the same name

    Sorry for the newbie question but I am very new and very much still learning.

    I wish to monitor several processes to see if they are running, the problem is that they have the same process name. I was going with something like.

    Code:
      Process[] ServerRunning = Process.GetProcessesByName("servername");
    
                        if (ServerRunning.Length == 0)
                        {
                            tabServer.BackgroundImage = Properties.Resources.redtab;
    
                        }
                        else
                        {
                            tabServer.BackgroundImage = Properties.Resources.greentab;
    
                        }
    So if there are two with the same name this does not seem to be the way to go. Can someone point me int he write direction. Thanks
  • dwayne2700
    New Member
    • Mar 2010
    • 3

    #2
    Let me add another question. Is there a way to start a process and change its name when starting? This would allow me to monitor them by name.

    Comment

    • dwayne2700
      New Member
      • Mar 2010
      • 3

      #3
      Sorry for the bump but I am not finding the answer. Thanks.

      Comment

      Working...