I was wondering how to kill an executable file from xna. i call the file from xna but when i try to close it, it just wont. I am using the Process.Kill() method, I was wondering if the if statements had something to do with this. I am trying to call the .exe when i press 2 and close it when i press 3.
here is the code i have so far.
…
private Process hello;
…
…
if (keyboardState.IsKeyDown(Keys.D2) || gamePadState.Buttons.Back == ButtonState.Pressed)
{
hello = Process.Start(@"C:\Users\VC\Downloads\On-ScreenKeyboardPortable\On-ScreenKeyboardPortable.exe");
}
if (keyboardState.IsKeyDown(Keys.D1) || gamePadState.Buttons.Back == ButtonState.Pressed)
{
hello.Kill();
}
Have you tried something like this?