I have created a WPF application with 2 buttons. On the click of first button executing a cmd and waiting for finishing of command because I need to read a result file after execution finish. On the second button click I am stopping execution of cmd by process kill.
But after start command execution, I am not able to stop execution before finishing execution of cmd.
Is there any way of parallel execution?
Start button code
string filename = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "nunit-console.exe");
Process proc = Process.Start(filename, "/result:" + resultFile + ".xml " + fileName);
proc.WaitForExit();