Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. public void Start()
  2. {
  3. try
  4. {
  5. Process process = new Process();
  6. process.StartInfo.FileName = "path of wget.exe";
  7. process.StartInfo.Arguments = "wget -r -c -np --retry-connrefused --tries=0 http://url/folder1 -P E:\Images --cut-dirs=2 -nH -A j2k -o E:\Images\error.log";
  8. process.EnableRaisingEvents = false;
  9. process.StartInfo.UseShellExecute = false;
  10. process.StartInfo.RedirectStandardError = true;
  11. process.StartInfo.WindowStyle = ProcessWindowStyle.Hide;
  12. process.ErrorDataReceived += new DataReceivedEventHandler(ProcessErrorDataRecieved);
  13. process.Start()
  14. process.BeginErrorReadLine();
  15. process.WaitForExit();
  16. }
  17. catch (Exception ex)
  18. {
  19. /////
  20. }
  21. }
  22. private void ProcessErrorDataRecieved(object sender, DataReceivedEventArgs e)
  23. {
  24. MessageBox.Show(e.Data);
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement