VB.Net: How to fill in a form in a website, then click at a button and download the file using webbrowser control?
I am 开发者_如何转开发using a WebBrowser-Control to fill in a webform and then click at a button, this currently results in a standard Download File Dialog (you get these if you download a file using internet explorer), but instead, I have to catch this file and save it automatically with a by me defined name to a specific folder.
I am trying to code a little application in vb.net which download the Export-file from my wordpress-blog, and I want to do this completely without user-interaction.
Currently everything works, except the downloading of the file. I tried to catch it with the event System.Windows.Controls.WebBrowser.Navigating(ByVal Object, ByVal System.Windows.Navigation.NavigatingCancelEventArgs) but I don't see where to download the file from :(
I hope you guys can help me.
Use WATIN. Very, very similar to the IE browser control, BUT it has all sorts of cool handlers for dialog pop ups, including security warnings and file download/save options.
You could use Fiddler to capture the HTTP request that is used to get the file and just record the response. Then, you could save the response body to a file.
Fiddler has extensive support for automation.
implement IServiceProvider on your webbrowser site and responde service queries to IDownloadManager
精彩评论