Hi ramco1917
ramco1917 says:
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.StartInfo = _process;
process.Start();
process.WaitForExit(10000);
process.Kill();
}
You could try to use HasExited property to determine if the process has exited.
Please replace above code with below code.
public static void RunVideo(string videolink)
{
Process process = new Process();
var _process = new ProcessStartInfo(@"C:\Program Files\Google\Chrome\Application\chrome.exe", videolink);
//Process.Start(_process);
process.StartInfo = _process;
process.Start();
if (!process.WaitForExit(10000))
{
if (!process.HasExited)
{
process.Kill();
}
}
}