ronayers
asked on
How do I determine if IP is in IP Range?
I want to check to see if an IP is in a supplied range of IP's. For example, is the IP 192.168.1.50 in the range of 192.168.1.25 - 192.168.1.68. How could i do that with VB.net?
Thanks
Thanks
Need to change the 'Or' in line 7 to 'And'
The posted code will not work properly because 192.168.12.6 would be consider in-range when it is not. Try this code instead:
http://www.freevbcode.com/ShowCode.asp?ID=7288
http://www.freevbcode.com/ShowCode.asp?ID=7288
ASKER
troyw1:
that will just tell me the subnet the IPs are own based off a range. That will not solve my problem. Any other ideas?
thanks
that will just tell me the subnet the IPs are own based off a range. That will not solve my problem. Any other ideas?
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
' Start 'Finish 'Check For
IsBetween("192.168.1.25 ", "192.168.1.68", "192.168.1.78") Returns False
IsBetween("192.168.1.25 ", "192.168.1.68", "192.168.1.50") Returns True
Regards
Steve
Open in new window