I'm implementing a network tool and I'm not sure what to use to store the set of ip addresses and ports to scan that the user is suppose to enter as parameters, namely: a Collection, a List or just Arrays. The user will enter the set of addresses and ports to scan through textboxes. Suggestions from experts and why.
internal class Network
{
internal enum Protocol { TCP, UDP };
private string[] strIpAddresses;
internal string GetIpAddress(int index = 0) { return strIpAddresses[index]; }
internal void SetIpAddress(int index = 0, string ip = "127.0.0.1") { this.strIpAddresses[index] = ip; }
private int[] intPorts;
internal int GetPort(int index = 0) { return intPorts[index]; }
internal void SetPort(int index = 0, int port = 80) { this.intPorts[index] = port; }
internal Network(string[] ipAddr, int[] ports, int IP_ADDR_SIZE_C, int PORT_SIZE_C)
{
this.strIpAddresses = new string[IP_ADDR_SIZE_C];
this.intPorts = new int[PORT_SIZE_C];
this.strIpAddresses = ipAddr;
this.intPorts = ports;
}
Thanks in advance.