I have a xaml application that has two buttons: one button starts execution of my exe application:
private void RunExe(string exeName)
{
try
{
process = new Process
{
StartInfo =
{
FileName = exeName,
Verb = "runas",
WorkingDirectory = workingDir,
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true,
},
EnableRaisingEvents = true
};
process.Start();
}
catch (Exception ex)
{
throw ex;
}
}
The other button is a 'Stop' button. When it's clicked i would like to stop exe execution until user confirms in pop up he wants to stop. If he confirms exe process should be stopped, otherwise it should continue. Is it possible to achive?