How can the Open/Save/Cancel dialog be disabled in a C# .NET application Webbrowser?
When downloadable content/server side scripts give the .NET Webbrowser a downloadable file, a dialog box is opened prompting the user to open/save/cancel the download. How can this window be prevented from appearin开发者_如何学运维g/ be disabled?
Thanks in advance.
Note: This is for a custom download manager in a browser I am building.
To take over downloading you need to implement IDownloadManager.
To register your download manager for a webbrowser control instance, you need to implement IServiceProvider on your IOleClientSite implementation and return your download manager when SID_SDownloadManager service is requested.
An example can be found at http://www.codeproject.com/KB/miscctrl/csEXWB.aspx. It is unclear which UI class library you are using, but you can use it in Windows Forms directly or in WPF via Windows Forms Interop.
精彩评论