Results 1 to 5 of 5

Thread: [2005] Web search.

  1. #1

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    [2005] Web search.

    Hi All,

    I'm trying to search the internet with a Webbrowser.
    It's working, but I'm not really pleased with the fact that I have to put the weppage and the abbreviation of the country in it before it shows me the page.
    That's the code to navigate into the web:

    Code:
    Private Sub Navigate(ByVal address As String)
    
            If String.IsNullOrEmpty(address) Then Return
            If address.Equals("about:blank") Then Return
            If Not address.StartsWith("http://") And _
                Not address.StartsWith("https://") Then
                address = "http://" & address
            End If
            If address.EndsWith("") then
               address = address & ("what should I put here for the abbreviations")
            End if
            Try
                webBrowser1.Navigate(New Uri(address))
            Catch ex As System.UriFormatException
                Return
            End Try
    
        End Sub
    Thanks in advance.

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  2. #2

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [2005] Web search.

    Hi All,

    I think I'm not clear enough.
    What I want to accomplish is that I can browse the internet with my Webbrowser.

    What I have so far is working, but I have to put the full name init like this:
    www.vb forum.com

    How or what do I have to change in my code that it can browse the internet with only a name like: airplanes or boots....

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: [2005] Web search.

    Code:
        Private Sub Navigate(ByVal address As String)
            If address.Equals("about:blank") Then Return
            If String.IsNullOrEmpty(address) Then Return
    
            If Not address.StartsWith("http://") Then
                TextBox1.Text = "http://" & TextBox1.Text
            End If
    
            Try
                WebBrowser1.Navigate(address)
            Catch ex As System.UriFormatException
                Return
            End Try
        End Sub
    
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Navigate(TextBox1.Text)
        End Sub
    :?

  4. #4

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [2005] Web search.

    Hi Fromethius,

    It works, but I have to write the complete url, and that isn't what I really wants.

    Is there a way to change my code that it's searching only by name.

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  5. #5

    Thread Starter
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [2005] Web search.

    Hi All,

    After a lot of reading and trying to create a good working webbrowser, I found that I shouldn't use the Navigate Sub.

    I found that I need to create a Search engine or Crawler to accomplish this.

    Is there someone who could put me into the good direction, with a link or example.

    Thanks in advance,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

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