显示自定义对话框当文件下载 [英] Display Custom Dialog When File Downloaded

查看:129
本文介绍了显示自定义对话框当文件下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

寻找解决我的问题。我们正在建立一个Web浏览器控件到一个产品的客户,他们需要能够启动Windows 7的文件浏览器窗口来检测时,有一个网站上的一个文件上传框,然后代替它,它需要自己开定制设计了一个

Looking for a solution to my issue. We are building a web browser control into a product for a client, they need to be able to detect when there is a File Upload box on a website, then instead of it launching the Windows 7 File Browser window, it needs to open their own custom designed one

有一个浏览器的事件,让我们捕捉到了吗?

Is there a browser event that allows us to capture that?

推荐答案

您可以关联自己的下载管理器,只有在通过控制站点上实现的IServiceProvider和实施QueryService的返回一个对象IDownloadManager时WebBrowser控件问你的web浏览器控制主机进程是有效的。

You can hook up your own download manager that is effective only in your webbrowser control host process by implementing IServiceProvider in the control site and implement QueryService to return an IDownloadManager object when asked by the webbrowser control

在Windows窗体的的网页浏览器类,将会为您默认创建一个控制的网站,但你可以的覆盖控制现场通过创建自己的 WebBrowserSiteBase 类并重写WebBrowser.CreateWebBrowserSiteBase方法。有没有这样的可扩展性,如果你使用WPF从,Silverlight的或Windows Phone WebBrowser控件。

In Windows Form's Webbrowser class, a control site is created for you by default, but you can override the control site by create your own WebBrowserSiteBase class and override the WebBrowser.CreateWebBrowserSiteBase Method. There is no such extensibility if you use the webbrowser control from WPF, Silverlight or Windows Phone.

我建议你写的下载管理器在C ++中,由于互操作的,如果你需要在C#code量。还有,使用本机下载管理器的>。

I suggest you write the download manager in C++ due to the amount of interop required if you code in C#. There's an example for a C# webbrowser control using a native download manager here.

这篇关于显示自定义对话框当文件下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆