Download and use Softperfect's free network scanner :
http://www.softperfect.com/products/...canner/manual/
It will help you understand these concepts a lot
easier than working on a theoretical basis.
In particular , check the "Options" - "Auto detect Local IP range" menu.
Download it at :
http://www.softperfect.com/download/
OTOH, you *can* ban by IP range in global.asax,
if you use the Left function in VB.NET.
i.e., if you are interested in banning IPs from 192.168.0.0 to 198.168.0.255
you'd check the UserHostAddress and use the Left function
to determine whether the leftmost 9 characters are 192.168.0.
That would identify the 256 IP addtesses from 192.168.0.0 to 198.168.0.255
The same principle applies to any IP range.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ :
http://asp.net.do/faq/
ASPNETFAQ.COM :
http://www.aspnetfaq.com/
Foros de ASP.NET en Español :
http://asp.net.do/foros/
======================================
<ri*************@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi,
I have to restrict access to a site based on IP address. While I have
been able to this successfully with code in the Global.aspx file, some
if the IP address are not single IP addresses but rather ranges.
If I know the network ID and the subnet mask, how can I check if a
given IP address falls within that range?
Thanks for any help,
Richard