|
-
Nov 3rd, 2006, 04:41 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Webbrowser class problem [VS2005 .NET 2.0]
Hello,
I am having a problem with some code I putting together. I am trying to implement a webbrowser class, without using the webbrowser control on a form. I want to navigate to a page, determine if the page is loaded, then extract the link collection and display them in a text box on a form.
Here is my code.
VB Code:
Dim I As Integer = 1
Dim WB As New WebBrowser
WB.Navigate(Me.URL.Text.Trim.ToString)
If (Not (WB.Document Is Nothing)) Then
Dim HDoc As HtmlElementCollection = WB.Document.Links
For I = 1 To HDoc.Count
Me.PageText.Text = Me.PageText.Text & HDoc.Item(I).ToString & vbCrLf
Next
End If
The problem I am having is that it says the WB.Document is nothing. Am I missing something? I am just learning .NET and this is the first time doing this, so I am not sure what I am missing. I have looked at MSDN, and done some googling, but don't see anything similar to what I am doing. Everyone else tries to use regex, but I think this would be better, if I can figure out how to do it.
Thank you for your help.
Last edited by Krenshau; Nov 4th, 2006 at 12:39 PM.
Reason: needed further assistance.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|