tags:

views:

175

answers:

1

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.

+2  A: 

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;
Trond
@Trond What about images without img tags? css sprites for example
Sergey Mirvoda