C# 停止 webbrowser 控件加载图像、flash、脚本等 [英] C# stop webbrowser control from loading images, flash, script, etc

查看:23
本文介绍了C# 停止 webbrowser 控件加载图像、flash、脚本等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何阻止网络浏览器加载/显示图像、Flash、脚本等?

How can i stop the webbrowser from loading/displaying images, flash, script etc?

我找到了这篇文章,但我不知道如何实现STDMETHODIMP CAtlBrCon::Invoke"函数

I found this article that deals with it, but i dont know how to implement that "STDMETHODIMP CAtlBrCon::Invoke" function

这是链接:文章

谁能指出我正确的方向?

Can anyone point me into the right direction?

推荐答案

流程是这样的:

控件在http:///csexwb2.googlecode.com/svn/trunk/cEXWB.cs 通知网络浏览器控件 ActiveX 主机内环境属性的变化.

The control calls the webbrowser's IOleControl.OnAmbientPropertyChange implementation in the SynchDOCDOWNLOADCTLFLAG function in http://csexwb2.googlecode.com/svn/trunk/cEXWB.cs to notify the webbrowser control about a change in ambient properties inside the ActiveX host.

Webbrowser 控件然后调用其主机的 IDispatch.Invoke 实现来查询更新的下载控件标志.

The the webbrowser control then calls its host's IDispatch.Invoke implementation to query for the updated download control flag.

主机的 DISPID_AMBIENT_DLCONTROL dispid 的 IDispatch.Invoke 实现看起来像这样

The host's IDispatch.Invoke implementation for the DISPID_AMBIENT_DLCONTROL dispid looks like this

[DispId(HTMLDispIDs.DISPID_AMBIENT_DLCONTROL)]public int Idispatch_AmbiantDlControl_Invoke_Handler(){返回(int)m_DLCtlFlags;}

[DispId(HTMLDispIDs.DISPID_AMBIENT_DLCONTROL)] public int Idispatch_AmbiantDlControl_Invoke_Handler() { return (int)m_DLCtlFlags; }

检查控制下载和执行 查看可用于更改浏览器行为的标志列表.

Check Controlling Download and Execution to see the list of flags you can use to change the behavior of the browser.

这篇关于C# 停止 webbrowser 控件加载图像、flash、脚本等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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