【发布时间】:2010-11-23 11:03:05
【问题描述】:
我正在尝试使用 .NET 自动每天检索 Web 文件。
该文件是一个 PDF,其地址类似于:
http://www.example.com/?s=doc20101022
这些是使用 IE 注册调试的 HTTP 请求的标头
HTTP/1.1 200 OK
Server: Apache/2.2.3 (CentOS)
Vary: User-Agent,Accept-Encoding
Expires: 0
Cache-Control: must-revalidate, post-check=0, pre-check=0
Pragma: public
Last-Modified: Mon, 22 Nov 2010 22:45:12 GMT
Cache-Control: private
Content-Disposition: attachment; filename="doc20101022.pdf"
Content-Transfer-Encoding: binary
Content-Type: application/force-download
Date: Tue, 23 Nov 2010 10:41:43 GMT
X-Varnish: 2155914052
Via: 1.1 varnish
Content-Length: 6596997
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Age: 2
您能否建议我使用 WebClient、WebBrowser 或其他 VB.NET (Framework 4.0) 组件获取并在本地保存它的方法?
【问题讨论】: