Exemple #1
0
        public Address(string address, string subnetmask)
        {
            AddressParts = new List<string>();

            AddressParts.Add(Converters.AddressToBin(address));
            //startingSlash = Converters.SubnetmaskToSlash(subnetmask);


            if (!Validators.IsValidAddressNetwork(address, subnetmask))
                throw new Exception("Questo non è un indirizzo di rete");
        }
Exemple #2
0
        public Address(string address, int slash)
        {
            AddressParts = new List<string>();
            string add = Formatters.RemovePoints(Converters.AddressToBin(address));
            AddressParts.Add(add.Substring(0,slash)); // Parte subnetmask
            AddressParts.Add(add.Substring(slash)); // Parte Host
            //startingSlash = slash;


            if (!Validators.IsValidAddressNetwork(address, Converters.SubnetmaskSlashToBin(slash)))
                throw new Exception("Questo non è un indirizzo di rete");
        }