flukester
asked on
compare single ip to ip range
I want to allow access to a certain folder based on IP address. I can get the IP address from user and check it and all that good stuff.
The problem is I have a table that holds 2 values, starting IP and ending IP, the majority of these are ranges, not single IP's. How can I check the single IP I get programatically against the table of IP ranges to authenticate a user?
The problem is I have a table that holds 2 values, starting IP and ending IP, the majority of these are ranges, not single IP's. How can I check the single IP I get programatically against the table of IP ranges to authenticate a user?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CompareTo is a comparison method for objects that implement IComparable. It returns less than zero if the instance is less than the passed obj, 0 if they are the same and greater than zero if the instance is greater than the passed obj.
http://msdn.microsoft.com/en-us/library/system.icomparable.compareto.aspx
http://msdn.microsoft.com/en-us/library/system.icomparable.compareto.aspx
ASKER
Thanks a lot!
ASKER