using System.Diagnostics; Process[] arrp = Process.GetProcesses(); foreach (Process p in arrp) { //close the chrome brower if (p.ProcessName == "chrome") p.kill(); }
using System.Diagnostics; using System; try { Process p = Process.GetProcessesByName("chrome"); p.kill(); } catch(Exception ex) { System.Console.WriteLine(ex.Message); }