Ramco Ramco

Ramco Ramco

  • 440
  • 3.4k
  • 527.5k

Unable to kill process

Dec 4 2022 2:05 PM

Hi

  I have below code but it does not go at - process.WaitForExit(10000); // milliseconds

public static void RunVideo(string videolink)
        {
            Process process = new Process();
            var _process = new ProcessStartInfo(@"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", videolink);
            //Process.Start(_process);
            process.StartInfo = _process;
            process.Start();
            process.WaitForExit(10000); // milliseconds
            process.Kill();

        }

Thanks


Answers (2)