0

I use ProcessStartInfo to download files. The code is as the following:

Process pc = new Process();
pc.StartInfo.FileName = Application.StartupPath + "\\" + [exe];
pc.StartInfo.Arguments = string.Format("Download {0}{1}{2} -out {3}{4}{5}", [some arguments]);
pc.StartInfo.UseShellExecute = false;
pc.StartInfo.CreateNoWindow = false;
pc.Start();
pc.WaitForExit();

But, when trying to install large files (+250 MB), it downloads but doesn't continue after WaitForExit.

Balagurunathan Marimuthu
  • 2,927
  • 4
  • 31
  • 44
  • It downloads *or* it downloads and the exe finishes? – Thomas Weller Dec 13 '16 at 19:11
  • "it downloads but doesn't continue after WaitForExit"... bet ya your mystery downloading exe is still running in the background (check task manager) – Trey Dec 13 '16 at 19:31
  • @Trey thanks for reply. So how to solve it by coding ? – Ahmed Hamouda Dec 14 '16 at 17:09
  • Welll.. that's a problem with the exe you are calling.... that being said, probably just enumerate the running tasks, and then end task that one through code. Really depends, I used to run into this with acrobat reader, and I always had to end the process manually. – Trey Dec 14 '16 at 17:59

0 Answers0