Results 1 to 3 of 3

Thread: System.NullReferenceException

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    164

    System.NullReferenceException

    Function GetHtml(ByVal url As String, ByRef web As WebBrowser) As String
    Dim WebString As String
    Dim myURI As New Uri(url)
    web.Url = myURI
    WebString = web.Document.Body.InnerHtml
    Return WebString
    End Function

    System.NullReferenceException!!!
    AS Above !! How to solve it!! Thank!!

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: System.NullReferenceException

    Which line?

    Regardless of anything else, don't pass your WebBrowser ByRef. There's no reason to.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2007
    Posts
    164

    Re: System.NullReferenceException

    Thank, I found the problem is the "browser loading " Bcos the browser not d/l completed .
    , the browser still blank and i used to get the innerhtml with blank document!! so got the error message!, !! thank!!

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