public String[] GetInterfaces() { // Count the number of interfaces HostConfiguration hostConfiguration = IP.GetHostConfiguration(); ICollection adapters = hostConfiguration.GetAdapterInfoCollection(); String[] names = new String[adapters.Count]; int i = 0; foreach (IAdapter ai in adapters) { names[i] = ai.NicName; i++; } return(names); }