我必须下载由“”表示的数百个文件在几个网页中。
我尝试使用 .NET Webbrowser 控件构建一个 .NET 程序,打开一个 URL(包含链接的页面),提取文档的源代码,找到链接...
所有这一切都非常简单,没问题。
现在,一旦我找到一个链接并指示网络浏览器导航到该文件链接,我就会看到一个对话框来保存文件(或打开它)等。
对于一两个文件来说就可以了。对于数百人,我需要使该过程自动化。
此外,当我用 Firefox 打开链接时,文件(文本文件)的内容会在浏览器中显示,而不是下载,这对我来说可能没问题,因为这样我就可以读取“源”(即文本中的文件内容)格式)并将其作为文件保存到磁盘。
有什么线索吗?或者也许有一些现有的实用程序可以完成这项工作?
I have to download hundreds of files that are represented by "<a href:"FileUrl"... />" within several web pages.
I try to build a .NET program with a .NET Webbrowser control, open a URL (the page containing the links), extract the document's source code, find the links...
All this is eezy peezy, no problem.
Now once I've found a link and I instruct the webbrowser to navigate to that file link, I'm presented with a dialog to save the file (or open it) etc.
For one or two files that's fine. For hundreds, I need to make the process automatic.
Besides, when I open the link with Firefox, the content of the file (textfile) is DISPLAYED within the browser, not DOWNLOADED, which could be fine for me, because then I could read the "source" (ie the file content in text format) and save it to disk as a file.
Any clue? Or maybe there is some existing utility that does the job?
发布评论
评论(1)
找到了!
一个用 VB 编写的非常简洁的 .NET HTTP 下载器类。唯一的问题是它是用法语写的(但请注意,我是法国人......:-)。
这是:
http://www .vbfrance.com/codes/NET2-CLASSE-TELECHARGMENT-HTTP-AVEC-GESTION-RESUME-PROGRESSION_41850.aspx
通过一些调整,您可以安排示例http下载程序以静默方式下载所有传递的文件网址,甚至通过一些进度事件来管理进度。
该类可以选择管理用户凭据并恢复中断的大文件下载。
Found it!
A really neat .NET HTTP downloader class written in VB. Only issue is its written in french (But I'm French mind you... :-).
Here it is:
http://www.vbfrance.com/codes/NET2-CLASSE-TELECHARGEMENT-HTTP-AVEC-GESTION-RESUME-PROGRESSION_41850.aspx
With a few tweaking, you can arrange the samplehttp downloader program to silently download all passed file url's, and even manage progresses through some progress event.
The class can optionnally manage user credentials and resume interrupted large file download.