private void kill_haggle_Click(object sender, EventArgs e) { if (LuckyMeLib.isHaggleRunning()) { int pid = LuckyMeLib.HagglePid(); if (pid != 0) { try { Process haggle = Process.GetProcessById(pid); haggle.Kill(); } catch (Exception) { Debug.WriteLine("No Haggle process with pid " + pid); } Debug.WriteLine("Could not get Haggle process pid"); } } else { Debug.WriteLine("Haggle is not running"); } }
private static void killHaggle() { System.Diagnostics.Process clsProcess; clsProcess = System.Diagnostics.Process.GetProcessById(LuckyMeLib.HagglePid()); if (clsProcess != null) { try { //clsProcess.Kill(); } catch (Exception e) { System.Diagnostics.Debug.WriteLine("Exception: " + e); } } }