How to intercept the WebBrowser control "Select file to download" before opening it?

My application should automate filling out forms and uploading files using the webBrowser control. When I invokeMember ("click"), the usual "Select file to download" form appears and appears in front of any other application that I can use at the same time. Is there a way to intercept this window so that I can skip filling out the form and uploading files in the background?

0
source share
2 answers

The answer is that you probably can, but most likely it will be an absurdly complicated process. You can connect to the CALLWNDPROCRET Windows notification chain, which allows you to receive events (for example, creating a dialog) before they are processed by the webbrowser control. I used this before to do things like suppress the "untrusted certificate" warning dialog box, however I would not recommend going that route unless you have a completely different choice.

+2
source

Due to security reasons, IE does not allow you to programmatically set the file to be downloaded. (In fact, you cannot even use SendKeys since Microsoft also closed this hole.)

, , HTTP- . , :

http://www.codeproject.com/KB/aspnet/set-webbrowser-file-input.aspx

0

All Articles