Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7488453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T14:55:01+00:00 2026-05-29T14:55:01+00:00

I save the client data into an array list. How to find part of

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T14:55:02+00:00Added an answer on May 29, 2026 at 2:55 pm

    You should use a typed List(Of Clients) instead, then cou can use LINQ:

    Dim clientList As New List(Of Clients)
    clientList.Add(new Clients())
    Dim isIPFound=clientList.Any(Function(ip) ip.ClientIPAdrress = currentIP)
    

    But essentially it is the same as your loop just in one row.

    If you need to find the fastest way, you could sort your list and BinarySearch the IP with a custom comparer. Or, if the IP is unique in the list, you could use a Dictionary(Of IPAdress,Clients) instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to use a WCF API to save data into a DB. Ordinarily,
How can save data into a XML file without user prompt dialog in Action
I want to save data from my database into xml file. I am using
So, when I save the data into database, PHP will add a \ on
I have a client app that needs to save a username/password for an SMTP
firefox wont allow the javascript to save a file in client machine is the
To save network traffic I'd like to compress my data. The only trick is
I have to send the audio data in byte array obtain by recording from
I am importing a good amount of data into my application using Core Data
I'm trying to save a file (pdf or image) uploaded from a form into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.