I'm trying to use WebControl to navigate a website and download a PDF file that is in an Embed tag
This is the web page that arrives (captured with Google Dev Tool):
<html>
<body marginwidth="0" marginheight="0" bgcolor="rgb(38,38,38)">
<embed width="100%" height="100%" name="plugin" src="https://www.prosper.com/secure/account/common/PDFFilePage.aspx?id=1fed9714de1a8e458762ae5852578c&stmtdtid=2" type="application/pdf">
</body>
</html>
When I get it (finally) in the WebBrowser control, I get:
<head></head>\r\开发者_JAVA百科n<body></body>
The pdf doc in the "Embed" tag gets lost. The DownloadBegin, DownloadProgress, DownloadComplete, FileDownload and DocumentComplete events all fire. I can see progress being made, the DownloadProgress event fires and the received counter goes up, but I can never find the downloaded pdf and the browser screen is blank.
Any ideas what I can do? The idea is to catch the PDF file and write it out to a database, but I can't seem to find it.
I believe you mean the WebBrowser control. I highly suggest you take a look at WatiN. It does for c# what jQuery did for javascript.
You can do this without WatiN, but it's more code, and you have to handle events that should be handled automatically for you, which is what WatiN can do.
精彩评论