public IpAddressesForm(IPAddress[] addresses)
        {
            InitializeComponent();

            string message = $"This domain has {addresses.Count()} IP Addresses associated with it.\r\n";
            foreach(var address in addresses)
            {
                message += address.ToString() + "\r\n";
            }
            uiIpAddressesTextBox.Text = message;

        }
Esempio n. 2
0
        /// <summary>
        /// Select the first IPv4Address in the given ipaddresses
        /// </summary>
        /// <param name="_addresses">The ipaddresses from which the method will select the first IPv4Address</param>
        /// <returns></returns>
        private IPAddress getIPv4Address(IPAddress[] _addresses)
        {
            Int32 i = new Int32();

            // while no IPv4Address is found
            while (i != _addresses.Count() && _addresses[i].AddressFamily != AddressFamily.InterNetwork)
            {
                i++;
            }

            // if no IPv4Address has been foudn
            if (i == _addresses.Count())
                return null;

            // return the selected IPv4Address
            return _addresses[i];
        }