I have created a simple web browser 开发者_高级运维using c# and I want to block the images to appear on WebBrowser control. Can you please show me a sample code for this? Thanks in advance.
You can remove image-tags from the source htm like this:
string content = new WebClient().DownloadString(@"http://www.google.com/");
string contentWithoutImages = Regex.Replace(content, @"<img(.|\n)*?>", string.Empty);
webBrowser1.DocumentText = contentWithoutImages;
精彩评论