public void GetIpList() { foreach (var ipAddress in _manager.GetIpList("192.168.88.105")) { var traceLine = $"{ipAddress.InterfaceId} : {ipAddress.Address} : {ipAddress.SubnetMask}"; Trace.WriteLine(traceLine); } }
public IEnumerable <string> Get(string ip = null) { Trace.WriteLine("Got list request"); var result = new List <string>(); try { var results = _networkManager.GetIpList() .Select(x => $"{x.InterfaceName} - {x.InterfaceId} : {x.Address} : {x.SubnetMask}"); result.AddRange(results); } catch (Exception e) { Trace.WriteLine(e.GetBaseException().ToString()); result.Add($"Cannot get ip list: {e.Message}"); } return(result); }