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