在documentcompleted事件之前禁用从webbrowser控件加载图像
我想阻止页面中的图像加载到WebBrowser
控件中。 我希望它在DocumentCompleted
事件发生之前发生。 有没有办法做到这一点?
您可以设置DISPID_AMBIENT_DLCONTROL 环境属性或更改浏览器进程的WinInet会话以使用可编程代理。
试试这段代码:
RegistryKey RegKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main", true); RegKey.SetValue("Display Inline Images", "no");
它更改了注册表项。