Combobox from the Internet to Combobox .NET

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts Page 1 of 1
Contributors
User avatar
3aaBrSbeel
Top Poster
Top Poster
Posts: 139
Joined: Fri Jun 01, 2012 9:34 am

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?
Code'n'Stuff Signature Of 3aaBrSbeel
®║▌│█│║▌║││█║▌║▌║▌
✔ Verified Official Code'n'Stuff account ᵀᴴᴱ ᴼᴿᴵᴳᴵᴻᴬᴸ
Image
User avatar
M1z23R
VIP - Donator
VIP - Donator
Posts: 622
Joined: Tue Sep 28, 2010 4:55 pm

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...
User avatar
3aaBrSbeel
Top Poster
Top Poster
Posts: 139
Joined: Fri Jun 01, 2012 9:34 am

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"
Code'n'Stuff Signature Of 3aaBrSbeel
®║▌│█│║▌║││█║▌║▌║▌
✔ Verified Official Code'n'Stuff account ᵀᴴᴱ ᴼᴿᴵᴳᴵᴻᴬᴸ
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

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
4 posts Page 1 of 1
Return to “Coding Help & Support”