【发布时间】:2013-05-09 06:05:33
【问题描述】:
我想使用 wget 在 3 个不同的位置下载多个文件,例如 www.google.com、yahoo.com 和 gmail.com。我该怎么做?请帮帮我..
我都是通过 c# 来做这一切的:
ProcessStartInfo startInfo = new ProcessStartInfo("CMD.exe");
Process p = new Process();
startInfo.RedirectStandardInput = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
p = Process.Start(startInfo);
p.StandardInput.WriteLine(@"wget --output-document=C:\1.xml xyz.com/a.xml");
p.StandardInput.WriteLine(@"wget --output-document=C:\2.xml xyz.com/b.xml");
p.StandardInput.WriteLine(@"wget --output-document=C:\3.xml xyz.com/c.xml");
p.StandardInput.WriteLine(@"EXIT");
string output = p.StandardOutput.ReadToEnd();
string error = p.StandardError.ReadToEnd();
p.WaitForExit();
p.Close();
这不起作用。想知道是否有任何其他方法可以使用 wget 下载多个文件..
【问题讨论】:
-
它怎么'不工作'?