Ok I have this thing,
It reads a string and checks to see if it has a certain number in it. If the number exists it must re-generate the number and check again to see if its available.
Its sshing into a server and running a netstat |grep command in order to see if the port is avillable. if it is available it connects if it does not find it available it regernreates the port number and checks again.
However i am drawing a blank on this one.
If readport.Contains(portstring) Then
MsgBox(portstring & "exists")
Dim randomport As New System.Random()
Dim randomid As Integer = randomport.Next(600, 6000)
Dim randomportnumber As Integer = randomport.Next(400, 4000)
portstring = randomportnumber.ToString()
TextBox1.Text = "2 465 " & portstring