check if process is open csharp

Code Example - check if process is open csharp

                
                        Process[] proc = Process.GetProcessesByName("chrome");
if (proc.Length == 0) {
  // run whatever here if process is NOT open
}
else {
  // run whatever here if process is open
}