Advertisement

04.29.2008 at 08:05AM PDT, ID: 23362290
[x]
Attachment Details

Want to strip images from Webbrowser output  and display results

Asked by EGormly in Microsoft Visual Basic.Net, Visual Studio 2008

Platform: Visual Studio 2008,  Language: Visual Basic.net

I have a simple browser based on a webbrowser control.
I want to only show text (and links) and not any images in the output.
All Images should be stripped. but links fully intact.

The user should only see the webpage without images.

I am not sure how to go about this, is there a way to do this automatically, or does each page need to be saved, striped and redisplayed?

I tried it that way, loading each pages source into a text box and then stripping images, saving the text to a file and navigating to that saved file but I get a crash....here is my attempt:

This is after loading the source into a text box.

        Do While InStr(TextBox2.Text, "<IMG") > 0
            FullLen = Len(TextBox2.Text)
            ImgStart = InStr(TextBox2.Text, "<IMG")
            FirstPart = Mid(TextBox2.Text, 0, ImgStart - 1)
            NewText = Mid(TextBox2.Text, ImgStart, FullLen - ImgStart)
            ImgEnd = InStr(NewText, ">")
            SecondPart = Mid(NewText, ImgEnd, FullLen - ImgStart + ImgEnd)
            TextBox2.Text = FirstPart + SecondPart
        Loop

from here I would save the file and then navigate to the file with the webbrowser.Start Free Trial
[+][-]04.30.2008 at 05:46AM PDT, ID: 21470163

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Visual Studio 2008
Sign Up Now!
Solution Provided By: gangwisch
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628