Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Im not sure if this is a correct place fro this post but here it is anyway btw thanx in advance for help

 

ok i have a webbrowser on my form called wb1 on startup, it loads a page that has some text on it. I wouldnt mind knowing how i can red some of that text of the page and place it in a label control

 

thanx guys

  • 3 weeks later...
Posted

You can use a webclient with streamreader to save the html code which of course has the text with it somewhere. Here is a sample code of how to import a webpages html code to a textbox. All you have to do from here is do a search through that string and pull out whatever you need. Im sure there is probably a better way to do this but this just came to my head :p

 

 

 

 

 

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

dim htmlstr as string

dim sr as io.streamreader

dim wc as new net.webclient

dim s as string

'--------------------------------------------------------------------------------

' this will create a large string and save it to var s

htmlstr = "http://mysite.com"

 

sr = New IO.StreamReader(wc.OpenRead(htmlstr))

s = sr.ReadToEnd

sr.DiscardBufferedData()

sr.Close()

wc.Dispose()

TextBox1.Text = s

 

's now contains all the html and displays it in a textbox

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...