Process [] localByName = Process.GetProcessesByName("abc");//因为可以同时启动多个abc.exe,所以返回值是数组。
using System.Diagnostics;
Process类的Id属性就是你要的PID