By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,694 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,694 IT Pros & Developers. It's quick & easy.

Storing links in string array using WebBrowser Control

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"Kruegy Man" <Kr*******@discussions.microsoft.com> wrote
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/microsof...dotnet.general
news://msnews.microsoft.com/microsof...t.languages.vb
news://msnews.microsoft.com/microsof....vsnet.general
news://msnews.microsoft.com/microsof...studio.general
news://msnews.microsoft.com/microsof....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/de...j_document.asp

HTH
LFS
Nov 21 '05 #2

P: n/a

"Kruegy Man" <Kr*******@discussions.microsoft.com> wrote
I have a WinForm application that has a WebBrowser Control.


Sorry for that previous post! I thought I was viewing a different group!

Nonetheless, the anchors collection of the Document object will help
you find all the links:

http://msdn.microsoft.com/library/de...j_document.asp
(oops)
LFS

Nov 21 '05 #3

P: n/a
Kruegy,

You need for that mshtml, it is a hard way to go and that part will be
improved in the 2005 version

http://msdn.microsoft.com/library/de...ng/hosting.asp

You have to set a reference to it, however never an import because your IDE
will freeze than because of the amount of interfaces in it.

I hope this helps?

Cor

"Kruegy Man"
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

Nov 21 '05 #4

P: n/a
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

"Cor Ligthert" wrote:
Kruegy,

You need for that mshtml, it is a hard way to go and that part will be
improved in the 2005 version

http://msdn.microsoft.com/library/de...ng/hosting.asp

You have to set a reference to it, however never an import because your IDE
will freeze than because of the amount of interfaces in it.

I hope this helps?

Cor

"Kruegy Man"
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


Nov 21 '05 #5

P: n/a

"Larry Serflaten" <se*******@usinternet.com> wrote
"Kruegy Man" <Kr*******@discussions.microsoft.com> wrote
I have a WinForm application that has a WebBrowser Control.
Nonetheless, the anchors collection of the Document object will help
you find all the links:

http://msdn.microsoft.com/library/de...j_document.asp


My bad, I should have gone there and looked closer....

Its the Links collection that has the links....

HTH
LFS
Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.