Question Get strings?

Joined
Oct 8, 2011
Messages
7
Location
Indonesia
Programming Experience
Beginner
So I've been working on a small project two days ago, its a program that works as a launcher. It's for connecting to game servers quickly, and retrieving server informations such as Online/Offline status, Number of players, Players list, Server version, Ping calculation(Which is closest to you.).

This my first question.

From the code bellow, I'm retrieving an IP list from the URL with a status id beside it. The id is to tell whether the node is possible to be connected or not. (1 = Online, 0 = Offline.) After I manage to get all the IP I am not sure how to separate them, because I need every IP separated and its ID's

            Dim webClient As System.Net.WebClient = New System.Net.WebClient()
            Dim result As String = webClient.DownloadString("http://mta.vg/server.php?exp=list")


After managing to separate the IP's and its ID's, I need the IP as Strings as well as the ID.

Then I will be doing Label1.Text = (IP String) for the IP's
As for the ID's I will be doing
If (id String) = "1" Then
        Label2.Text = "Online"
Else If (id string) = "2" Then
        Label2.Text = "Offline"
End If


If anyone could help me solve this, I would greatly thank you.
 
data sample said:
195.5.121.97;1
46.4.175.150;1
96.43.138.244;0
46.4.148.132;1
You can use String.Split to split the pairs by vbNewLine string, then split each by semicolon char.
Instead of the first split you can also load the string into a StringReader and read line by line from that.
 
Back
Top