Wpf webbrowser, how to detect when it tries to download?

时光怂恿深爱的人放手 提交于 2019-12-10 18:41:39

问题


When you use the C#.Net wpf WebBrowser control to view html pages, and the user clicks on a link to a file with an unknown extension, the webbrowser tries to download this file.

On systems with no pdf viewer installed, webbrowser tries to download pdf files instead of either displaying them or warning the user that they need Adobe, etc.

I would like to detect when a webbrowser tries to download, so I can check if the file is pdf and then provide a download link.

Is this possible?

来源:https://stackoverflow.com/questions/6927909/wpf-webbrowser-how-to-detect-when-it-tries-to-download

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!