Exemplo n.º 1
0
        internal GatewayIPAddressInformationCollection ToIPGatewayAddressCollection()
        {
            IpAddrString str = this;
            GatewayIPAddressInformationCollection informations = new GatewayIPAddressInformationCollection();

            if (str.IpAddress.Length != 0)
            {
                informations.InternalAdd(new SystemGatewayIPAddressInformation(IPAddress.Parse(str.IpAddress)));
            }
            while (str.Next != IntPtr.Zero)
            {
                str = (IpAddrString)Marshal.PtrToStructure(str.Next, typeof(IpAddrString));
                if (str.IpAddress.Length != 0)
                {
                    informations.InternalAdd(new SystemGatewayIPAddressInformation(IPAddress.Parse(str.IpAddress)));
                }
            }
            return(informations);
        }
Exemplo n.º 2
0
        internal IPAddressCollection ToIPAddressCollection()
        {
            IpAddrString        str      = this;
            IPAddressCollection addresss = new IPAddressCollection();

            if (str.IpAddress.Length != 0)
            {
                addresss.InternalAdd(IPAddress.Parse(str.IpAddress));
            }
            while (str.Next != IntPtr.Zero)
            {
                str = (IpAddrString)Marshal.PtrToStructure(str.Next, typeof(IpAddrString));
                if (str.IpAddress.Length != 0)
                {
                    addresss.InternalAdd(IPAddress.Parse(str.IpAddress));
                }
            }
            return(addresss);
        }
Exemplo n.º 3
0
        internal ArrayList ToIPExtendedAddressArrayList()
        {
            IpAddrString str  = this;
            ArrayList    list = new ArrayList();

            if (str.IpAddress.Length != 0)
            {
                IPAddress address = IPAddress.Parse(str.IpAddress);
                list.Add(new IPExtendedAddress(address, IPAddress.Parse(str.IpMask)));
            }
            while (str.Next != IntPtr.Zero)
            {
                str = (IpAddrString)Marshal.PtrToStructure(str.Next, typeof(IpAddrString));
                if (str.IpAddress.Length != 0)
                {
                    IPAddress introduced3 = IPAddress.Parse(str.IpAddress);
                    list.Add(new IPExtendedAddress(introduced3, IPAddress.Parse(str.IpMask)));
                }
            }
            return(list);
        }