I save the client data into an array list. How to find part of data(currentIP) inside the array list(clientList) with fast method ?
Code as follow:
' Array list to keep Clients Object
Protected Friend clientList As ArrayList = ArrayList.Synchronized(New ArrayList())
Public Class Clients
public clientIPAdrress As IPAddress
public clientTCP As TcpClient
public clientStream As SslStream
End Class
Public Sub Test()
' Create objClients Object from Clients Class
Dim objClients as new Clients
' Add objClients to Array List
clientList.Add(objClients)
Dim currentIP as IPAdress = IPAddress.Parse("192.168.1.2")
Dim isIPFound as Boolean = False
' Search currentIP inside clientList with looping method
For Each ip As Clients In clientList
If ip.ClientIPAdrress = currentIP Then
isIPFound = True
Exit For
End If
Next
End Sub
Thanks for the advice.