Exemplo n.º 1
0
        /// <summary>
        /// Fetch next non-ping able IPAddress
        /// If we want to assign an IPAddress to the printer manually
        /// this method fetches the non-ping-able IPAddress from the subnet
        /// </summary>
        /// <param name="subnetMask">subnet mask of the printer</param>
        /// <param name="printerIP">IPAddress of the printer</param>
        /// <returns>Returns a new non-ping-able IPAddress</returns>
        public static IPAddress FetchNextIPAddress(IPAddress subnetMask, IPAddress printerIP)
        {
            IPAddress newIPAddress = IPAddress.None;

            newIPAddress = IPAddressUtil.NextAssignable(printerIP, subnetMask);
            while (PingUntilTimeout(newIPAddress, 0))
            {
                newIPAddress = IPAddressUtil.NextAssignable(newIPAddress, subnetMask);
            }

            return(newIPAddress);
        }