TAN WhoAMI

TAN WhoAMI

  • NA
  • 291
  • 0

Check if other PCs in network running the program

Aug 19 2013 9:50 PM
I want to check if certain program is executing from other PCs in the network. I test with below code, which works for local PC. How do I extend to check for other PCs in the network?

thanks.

using System;
using System.Text;
using System.Diagnostics;
using System.Windows.Forms;
using System.Linq;

class Program
{
  static void Main(string[] args)
  {
    bool isRunning = Process.GetProcessesByName("Abc")
                .FirstOrDefault(p => p.MainModule.FileName.StartsWith(@"X:\ABC\test\Bin")) != default(Process);
    
    if (! isRunning)
       MessageBox.Show("nothing");
    else
      MessageBox.Show("run");
   
  }
}


Answers (1)