How can i calculate the range from an Ip?
For example,i found that my pc's current local ip is 192.168.1.2.I want to list from 192.168.1.1 to 192.168.1.254.
Also,is there a way to calculate the netmask length?
Any help would be appreciated!
How can i calculate the range from an Ip?
For example,i found that my pc's current local ip is 192.168.1.2.I want to list from 192.168.1.1 to 192.168.1.254.
Also,is there a way to calculate the netmask length?
Any help would be appreciated!
There is no way to retrieve a netmask from an IP address. You need to know the mask for a particular subnet.
milli (17th May 2011)
If that is the address of one of your local machine interfaces then you can get the network mask (or prefix length) for that interface in the relevant QNetworkAddressEntry otherwise, as Wysota says, you cannot derive it.
Bookmarks