Im trying to program one single button to open and close an exe file, so when I press it once, it opens the file, when I press it again then it closes the file.
Im able to program the button to open the file but i cannot get it to close.
private void button1_click(object sender, EventArgs e)
{
Process proc = new Process();
proc.StartInfo.FileName = @"C:\Program Files (x86)\TeamViewer\TeamViwer.exe";
proc.Start();
}