Ejemplo n.º 1
0
 private void Run2_Click(object sender, RoutedEventArgs e)
 {
     if (iP.GetClass() == 'a' || iP.GetClass() == 'b' || iP.GetClass() == 'c')
     {
         P2.Visibility = Visibility.Hidden;
         P3.Visibility = Visibility.Visible;
         S             = new Subnetting();
         S.GetNetWorkDetails(iP);
     }
 }
Ejemplo n.º 2
0
        private void Run_Click(object sender, RoutedEventArgs e)
        {
            iP           = new IP();
            iP.IpAddress = Ip.Text;
            iP.GetIP();
            Boolean p = iP.IpAddress.Equals("Error");

            if (p)
            {
                Ip.Text       = "Error";
                Ip.Foreground = Brushes.Red;
            }
            else
            {
                P1.Visibility = Visibility.Hidden;
                P2.Visibility = Visibility.Visible;
                char   ipClass = iP.GetClass();
                string subnet  = iP.ReturnSubnet();
                IPDMask.Content = subnet;
                if (ipClass != '0' && ipClass != 'l')
                {
                    IPC.Content = ipClass.ToString().ToUpper();
                }
                //Console.WriteLine($"IP Class: {ipClass.ToString().ToUpper()}");
                if (ipClass == 'l')
                {
                    IPC.Content = "LocalHost Entered";//Console.WriteLine("LocalHost Entered");
                    return;
                }
                if (ipClass == 'a' || ipClass == 'b' || ipClass == 'c')
                {
                    String[] SubnetOctet = iP.SubnetToBinary();
                    IPDMaskBIN.Content = string.Join('.', SubnetOctet);
                }
            }
        }