kill a process on hitting stop button
I have this code:
Process p = Process.GetProcessByName("notepad").FirstofDefault(); if( p == null ) p = Process.Start("notepad.exe");I wish to kill this p on hitting the stop button, how do I do that? thanks!
Comments
If the process already exists, you could subscribe to the Util.Cleanup event to terminate it.