Disable Image loading on WebBrowser-Control C# .Net 2.0+

两盒软妹~` 提交于 2019-12-10 10:27:54

问题


I am using vs2008 and I would like to disable image loading on my webbrowser control but I dont see any solution except for the WebBrowserEX which doesn't seem outside of .net 1.1.

Anyone know how to do this? Thanks!


回答1:


you should replace its tag , give the following code a try

var html = webBrowser.DocumentText;
var newOne = Regex.Replace(html, "<img.*/>", "", RegexOptions.Multiline);
webBrowser.DocumentText = newOne;


来源:https://stackoverflow.com/questions/1260615/disable-image-loading-on-webbrowser-control-c-sharp-net-2-0

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