Storing links in string array using WebBrowser Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a WinForm application that has a WebBrowser Control.

I can navigate to any website fine.

I want to store the link addresses in an array to be called back later.

For example, if I visit a news website's main page (www.newswebsite.com),
they will have links to other stories. The links' address usually appears in
the status bar when you mouse over the link (say for example,
www.newswebsite.com/story1).

How do I "get" these links off of a webpage?

Now that I think about it, I'll need to know how many links are on the page
to run the loop that creates the array.

Any ideas?

John
 
Kruegy Man said:
I have a WinForm application that has a WebBrowser Control.

You will very likely get more informed responses if you
post your question to a group where they discuss .NET.

A few you might pick from include:

news://msnews.microsoft.com/microsoft.public.dotnet.general
news://msnews.microsoft.com/microsoft.public.dotnet.languages.vb
news://msnews.microsoft.com/microsoft.public.vsnet.general
news://msnews.microsoft.com/microsoft.public.vstudio.general
news://msnews.microsoft.com/microsoft.public.vstudio.setup

How do I "get" these links off of a webpage?

The brwoser shows documents, and has a Document property.
You can learn what that document contains through that property.

Check out the anchors collection of the Document object:
http://msdn.microsoft.com/library/d...thor/dhtml/reference/objects/obj_document.asp

HTH
LFS
 
Larry / Cor,

Thank you for your replies. They got me pointed in the right direction.

This is my first time jumping into Web stuff. I'm used to just standard
Win32 Apps.

Thanks again,

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top