Deutsch
Ich habe mir einige IP-Einschränkungsfunktionen angesehen und fand sie zu kompliziert. Also habe ich versucht, eines zu schreiben, das relativ einfach ist. Internetnutzer lesen bitte diesen Leitfaden. Danke! ~
Code-Kopierfeld <% 'Rufen Sie die Adresse des Besuchers ab ip=Request.ServerVariables("REMOTE_ADDR") 'Der zulässige IP-Adressbereich ist 10.0.0.0~10.68.63.255allowip1="10.0.0.0"allowip2="10.68.10.71"response.write checkip ( ip,allowip1,allowip2) function checkip(ip,allowip1,allowip2) dim check(4) checkip=false ipstr=split(ip,".")allow1=split(allowip1,".")allow2=split(allowip2, " .") if cint(allow1(0))>cint(allow2(0)) then 'Beurteilen Sie, ob das IP-Adresssegment zulässig ist. Antwort. Schreiben Sie "Das IP-Adresssegment ist falsch!" Exit-Funktion beenden, wenn für i=0 bis ubound(ipstr ) if cint(allow1(i))<cint(allow2(i)) then if cint(allow1(i))=cint(ipstr(i)) then check(i)=true checkip=true Exit für else if cint( ipstr(i))<cint(allow2(i)) then check(i)=true checkip=true Exit für else if cint(ipstr(i))>cint(allow2(i)) then check(i) =false checkip =false Exit für else check(i)=true checkip=true end if end if end if else if cint(allow1(i))>cint(ipstr(i)) oder cint(allow1(i))<cint (ipstr( i)) then check(i)=false checkip=false if i<>ubound(ipstr) then exit for end if else check(i)=true end if end if next if (check(0)=true and check(1 )=true und check(2)=true und check(3)=false) und (cint(allow2(2))>cint(ipstr(2))) then checkip=true end if end function %>