Page 1 of 1

Combobox from the Internet to Combobox .NET

Posted: Mon Aug 20, 2012 2:14 am
by 3aaBrSbeel
How do you sync or get all the info in that Combobox from the Internet to the Combobox .NET.

For Example: The Listbox from the Internet contains. All the Maps. How can I connect that to my Listbox .NET?

Re: Combobox from the Internet to Combobox .NET

Posted: Mon Aug 20, 2012 7:47 pm
by M1z23R
You need to get data using http request / response and then split the received data and add each splitted part in listbox items.
If you tell me where are you getting the list from maybe i can help you...

Re: Combobox from the Internet to Combobox .NET

Posted: Tue Aug 21, 2012 12:42 am
by 3aaBrSbeel
M1z23R wrote:
You need to get data using http request / response and then split the received data and add each splitted part in listbox items.
If you tell me where are you getting the list from maybe i can help you...
http://www.sendmassage.com/spage/send-f ... dwide.html
Down below "Select country"

In the source. The combobox name is "connect"

Re: Combobox from the Internet to Combobox .NET

Posted: Tue Aug 21, 2012 11:44 pm
by mandai
I think there would be more effort involved if you are trying to parse the HTML directly.
How do you sync or get all the info in that Combobox from the Internet to the Combobox .NET.
You could use this with a webbrowser control:
Code: Select all
    Private Sub WebBrowser1_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted

        If e.Url.ToString() = "http://www.sendmassage.com/spage/send-free-sms-worldwide.html" Then

            Dim selects As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("select")

            For i As Integer = 0 To selects.Count - 1

                If selects(i).Name = "connect" Then

                    Dim options As HtmlElementCollection = selects(i).GetElementsByTagName("option")

                    For i2 As Integer = 0 To options.Count - 1
                        Dim countryname As String = options(i2).InnerText
                        ComboBox1.Items.Add(countryname)

                    Next

                    Exit For
                End If
            Next

        End If

    End Sub