I'm building a telnet server and I need a type of arraylist. I need this arraylist to contain an index 0 - 100 thats how many connections I allow at once, and an Ip address so when I refer to index 0 it will give me the ipaddress.

I'm new to arrays in c#, i'm used to the good old ones from vb6 so detail will be nice. What would the best array be?

Recommended Answers

All 3 Replies

Suppose the datatype you're using to hold an IP address is called IPAddress. Then you would want to use a List<IPAddress> to hold your IP addresses. If the datatype you're using is string, you'd want to use a List<string> . If a uint, use List<uint> .

I'm wondering I need an array for a socket too connected to the same array so that I can for example conn is my array, conn[this].WriteLine("Test"), and if I need to I can pull data from that connection array such as the IP and username etc

Ok I figured it out, I just added all the objects in a class and then made an arraay

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.