示例#1
0
        public static List <ListaConexoesHost> ObterIps()
        {
            IPIdentificados = new List <ListaConexoesHost>();

            NetworkInterface[] Interfaces = NetworkInterface.GetAllNetworkInterfaces();
            foreach (NetworkInterface Int in Interfaces)
            {
                foreach (UnicastIPAddressInformation UniInform in Int.GetIPProperties().UnicastAddresses)
                {
                    IPIdentificados.Add(new ListaConexoesHost {
                        Interface = Int.Name, Link = Int.Speed, Status = Int.OperationalStatus, Tipo = Int.NetworkInterfaceType, IP = UniInform.Address.ToString()
                    });
                }
            }
            return(IPIdentificados);
        }