private void ComboSubnet_Initialized(object sender, EventArgs e)
        {
            for (int i = 1; i <= 128; i++)
            {
                System.Net.IPNetwork ipnetwork = System.Net.IPNetwork.Parse("2001:0db8::/" + i);
                if (i < 64)
                {
                    BigInteger biig = new BigInteger();
                    biig = (BigInteger)Math.Pow(2, 64 - i);

                    comboSubnet.Items.Add("" + i + " ( " + String.Format("{0:n0}", biig) + " networks /64 )");
                }
                else
                {
                    comboSubnet.Items.Add("" + i + " ( " + String.Format("{0:n0}", ipnetwork.Usable) + " Address /64)");
                }
            }
            comboSubnet.SelectedIndex = 0;
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                System.Net.IPNetwork ipnetwork = System.Net.IPNetwork.Parse(inputIIP.Text + "/" + (comboSubnet.SelectedIndex + 1));
                tvIP.Content          = "IP address = " + formatIP(inputIIP.Text) + "/" + (comboSubnet.SelectedIndex + 1);
                tvIPfull.Content      = "IP address (full) = " + formatFullIP(formatIP("" + inputIIP.Text));
                tvIPFirst.Content     = "First = " + formatFullIP(formatIP("" + ipnetwork.FirstUsable));
                tvIPLast.Content      = "Last = " + formatFullIP(formatIP("" + ipnetwork.LastUsable));
                tvIPTotal.Content     = "Total IP addresses = " + String.Format("{0:n0}", ipnetwork.Total);
                tvNetwork.Content     = "Network = " + ipnetwork.Network;
                tvNetmask.Content     = "Netmask = " + ipnetwork.Netmask;
                tvIPBroadcast.Content = "Prefix length = " + (comboSubnet.SelectedIndex + 1);
            }

            catch (Exception p)
            {
                MessageBox.Show("Invalid IP address. \n Exaxple: 2221:0db8::");
            }
        }