Question : vb.net declade ip address

hello there,
I am trying to do this using vb.net but its not working how I want

dim ipString as string = "127.0.0.1"

ipString = ipString +1

so that it could be 127.0.0.2 but it doesnt work.. how can I do that so that it changes from 127.0.0.255 to 127.0.1.0 etc..etc?

Answer : vb.net declade ip address

This Function will answer perfectly your initial question. It increment by +1 a string IP address.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
    Private Function IncIP(ByVal ip As String) As String
        Dim arr As String()
        Dim a As Integer
        Dim b As Integer
        Dim c As Integer
        Dim d As Integer

        arr = ip.Split(".")
        a = Integer.Parse(arr(0))
        b = Integer.Parse(arr(1))
        c = Integer.Parse(arr(2))
        d = Integer.Parse(arr(3)) + 1

        If d = 256 Then
            d = 0
            c = c + 1
        End If
        If c = 256 Then
            c = 0
            b = b + 1
        End If
        If b = 256 Then
            b = 0
            a = a + 1
        End If
        If a = 256 Then
            a = 127
        End If

        IncIP = String.Format("{0}.{1}.{2}.{3}", a, b, c, d)
    End Function
Random Solutions  
 
programming4us programming4us