MadDriver' Alıntı:onu bizde biliyoruz. Gelde o şekilde 192.168.0.0 - 192.168.144.255 aralığını banla
Bana lazım olan belirli aralıktaki ipleri banlamak.
<%
ip = Request.ServerVariables("REMOTE_ADDR")
ip1 = "216.254.255.250"
ip2 = "217.1.10.12"
ip1 = Split(ip1,".")
ip2 = Split(ip2,".")
ip1_4 = ip1(3)
if ip2(2) > ip1(2) or ip2(1) > ip1(1) or ip2(0) > ip1(0) then
ip2_4 = 255
else
ip2_4 = ip2(3)
end if
ip1_3 = ip1(2)
if ip2(1) > ip1(1) or ip2(0) > ip1(0) then
ip2_3 = 255
else
ip2_3 = ip2(2)
end if
ip1_2 = ip1(1)
if ip2(0) > ip1(0) then
ip2_2 = 255
else
ip2_2 = ip2(1)
end if
ip1_1 = ip1(0)
ip2_1 = ip2(0)
for m = ip1_1 to ip2_1
for l = ip1_2 to ip2_2
for k = ip1_3 to ip2_3
for i = ip1_4 to ip2_4
response.Write(m&"."&l&"."&k&"."&i&"<br>")
next
ip1_4 = 0
if ( k = ((ip2(2))-1)) or (ip2(2) = 0 and k = 255) then
ip2_4 = ip2(3)
else
ip2_4 = 255
end if
if (ip2(3) = 0 and i = 255) or ((ip2(2) = 0 and k = 255) and (ip2(1) = 0 and l = 255)) then
ip2_4 = ip2(3)
end if
next
ip1_3 = 0
if l = ((ip2(1))-1) then
ip2_3 = ip2(2)
else
ip2_3 = 255
end if
if (ip2(1) = 0 and l = 255) then
ip2_3 = ip2(2)
end if
next
ip1_2 = 0
if m = ((ip2(0))-1) then
ip2_2 = ip2(1)
else
ip2_2 = 255
end if
next
%>
IP ARALIGI YASAKLAMA
# 194.168.0.1 ile 194.168.255.255 arasi yasakli #
<%
' ### Hangi aralikta baslayacaksa.
BaslangicIP = "194.168.0.1"
BaslangicSp = Split(BaslangicIP, ".")
BaslangicIP = (BaslangicSp(0)*(256*256*256)) + (BaslangicSp(1)*(256*256)) + (BaslangicSp(2)*256) + (BaslangicSp(3))
' ### Hangi aralikta bitecekse
BitisIP = "194.168.255.255"
BitisSp = Split(BitisIP, ".")
BitisIP = (BitisSp(0)*(256*256*256)) + (BitisSp(1)*(256*256)) + (BitisSp(2)*256) + (BitisSp(3))
' ### hangi ip aranacaksa
AranacakIP = Request.ServerVariables("REMOTE_HOST")
AranacakSp = Split(AranacakIP, ".")
AranacakIP = (AranacakSp(0)*(256*256*256)) + (AranacakSp(1)*(256*256)) + (AranacakSp(2)*256) + (AranacakSp(3))
If BaslangicIP < AranacakIP and BitisIP > AranacakIP Then
Response.write "BU SITEYE GIRISIN YASAK"
Else
Response.write "GECIS SERBEST KOLAY GELSIN."
End If
%>