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
|