Disable image loading from webbrowser control before the documentcompleted event

北城余情 提交于 2019-11-28 03:57:31

问题


I want to prevent images in a page from being loaded in the WebBrowser control. I want it to happen before the DocumentCompleted event occurs. Is there a way to do this?


回答1:


You can set the DISPID_AMBIENT_DLCONTROL ambient property or change the browser's process's WinInet session to use a programmable proxy.




回答2:


Try this code:

RegistryKey RegKey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Internet Explorer\Main", true);
RegKey.SetValue("Display Inline Images", "no");

It changes registry key.



来源:https://stackoverflow.com/questions/2048424/disable-image-loading-from-webbrowser-control-before-the-documentcompleted-event

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