WebBrowser:如何自动允许activeX内容 [英] WebBrowser: How to automatically allow activeX content

查看:91
本文介绍了WebBrowser:如何自动允许activeX内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我要打开在本地计算机上找到的一组使用ActiveX控件的html文件.

I have a problem where I am opening a set of html files found on the local computer which use ActiveX controls.

不断出现的通知弹出窗口在每个页面上都令人沮丧.

The constant notification popup is frustrating as every page it appears.

我无法更改该文件,因为它是由外部应用程序生成的,并且我通常不希望为IE启用ActiveX控件.

I cannot change the file as it is generated by an external application and I do not want enable ActiveX controls for IE in general.

我想做的是允许我的Web浏览器控件(嵌入在WPF窗口中)自动允许被阻止的内容(如果它来自本地计算机)(或者至少是任何被阻止的内容,因为我可以控制我的Web浏览器控件的内容)可以和不能打开)

What I would like to do is allow my webbrowser control, embedded in a WPF window, to allow blocked content automatically if it is from the local computer (or at the very least any blocked content as I can control what my webbrowser control can and cannot open)

我看不到任何明显的方法,没有选项允许被阻止的内容,也没有事件来标识何时阻止竞争.

I cannot see any obvious way of doing this, there are no options to allow blocked content and no event for identifying when blocked contetn has been foud.

有什么办法可以做到这一点?

Is there any way to achieve this?

谢谢

编辑-对于这个问题有很多观点,但没有一个评论.我将欢迎任何建议,甚至可能是其他控件,我意识到默认的WebBrowser并不理想.还有其他提供此功能的浏览器吗?

EDIT - There have been plenty of views for this question but not a single comment. I will welcome any suggestions, perhaps even an alternative control, I realise the default WebBrowser is not ideal. Are there any other browsers that do offer this feature?

要为这个问题添加一些细节,我想我应该再解释一些要求:

To add a little detail to the problem I think I should explain the requirements some more:

所显示的资源是一组HTML文件,这些HTML文件由无法更改的旧版工具作为报告生成.我构建的工具将允许用户定义报告的目标,然后允许他们使用嵌入式浏览器进行浏览.我真的只需要一个控件,该控件可以像浏览器一样呈现html和ActiveX控件,但不会受到Internet安全设置的任何干扰.

The resource being displayed is a set of html files that are generated as a report by a legacy tool that cannot be changed. The tool I have built will allow the user to define the destination for the report and then allow them to browse it using an embedded browser. I really just need a control that will render html and ActiveX controls as a browser would but without any interference from internet security settings.

更新-不幸的是,我不再从事这个项目,但是我对这个问题/修复很感兴趣,所以我不得不尝试在业余时间复制它.

UPDATE - Unfortunately I am no longer working on this project, however I am interested in the problem/fix so I shal try and replicate it in my spare time.

当我意识到我要专门处理的问题是ActiveX内容时,我也重命名了该问题,它可能有一个针对此类内容的解决方案(请参见Rajesh的答案).

I have also renamed the question as I realise the problem I am dealing with specifically is ActiveX content, which may have a solution (see answer from Rajesh) which is specific to this type of content.

推荐答案

只需在html标记之前的开始位置将此行添加到html页面即可.

Simply add this line to your html page at the start before the html tag.

<从url =(0023)中保存 http://www.contoso.com/

< saved from url=(0023)http://www.contoso.com/

,然后选择并评论.

这篇关于WebBrowser:如何自动允许activeX内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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