Results 1 to 8 of 8

Thread: [RESOLVED] Webbrowser class problem [VS2005 .NET 2.0]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Resolved [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:
    1. Dim I As Integer = 1
    2.         Dim WB As New WebBrowser
    3.  
    4.         WB.Navigate(Me.URL.Text.Trim.ToString)
    5.  
    6.         If (Not (WB.Document Is Nothing)) Then
    7.             Dim HDoc As HtmlElementCollection = WB.Document.Links
    8.  
    9.             For I = 1 To HDoc.Count
    10.                 Me.PageText.Text = Me.PageText.Text & HDoc.Item(I).ToString & vbCrLf
    11.             Next
    12.         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
  •  



Click Here to Expand Forum to Full Width