{"id":200,"date":"2008-12-04T08:51:19","date_gmt":"2008-12-04T00:51:19","guid":{"rendered":""},"modified":"2014-02-27T22:59:40","modified_gmt":"2014-02-27T14:59:40","slug":"asp-%e4%b8%ad%e5%af%b9-ip-%e8%bf%9b%e8%a1%8c%e8%bf%87%e6%bb%a4%e9%99%90%e5%88%b6%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2008\/12\/04\/200.htm","title":{"rendered":"asp \u4e2d\u5bf9 ip \u8fdb\u884c\u8fc7\u6ee4\u9650\u5236\u51fd\u6570"},"content":{"rendered":"<p>\u770b\u4e86\u4e00\u4e9bIP\u9650\u5236\u7684\u51fd\u6570\uff0c\u89c9\u5f97\u592a\u590d\u6742\u3002\u6240\u4ee5\uff0c\u8bd5\u7740\u5199\u4e86\u4e00\u4e2a\uff0c\u6bd4\u8f83\u7b80\u5355\u3002\u8bf7\u7f51\u53cb\u53c2\u8003\u6307\u6559\u3002\u8c22\u8c22\uff01\uff5e&nbsp; <\/p>\n<p>\u4ee3\u7801\u62f7\u8d1d\u6846&nbsp; <br \/>\n&lt;%&nbsp; <br \/>\n&rsquo;\u83b7\u53d6\u8bbf\u95ee\u8005\u7684\u5730\u5740&nbsp; <br \/>\nip=Request.ServerVariables(&quot;REMOTE_ADDR&quot;)&nbsp;&nbsp; <\/p>\n<p>&rsquo;\u5141\u8bb8\u7684IP\u5730\u5740\u6bb5\u4e3a10.0.0.0\uff5e10.68.63.255&nbsp; <br \/>\nallowip1=&quot;10.0.0.0&quot;&nbsp; <br \/>\nallowip2=&quot;10.68.10.71&quot;&nbsp; <\/p>\n<p>response.write&nbsp;checkip(ip,allowip1,allowip2)&nbsp; <\/p>\n<p>\nfunction&nbsp;checkip(ip,allowip1,allowip2)&nbsp; <br \/>\ndim&nbsp;check(4)&nbsp; <br \/>\ncheckip=false&nbsp; <br \/>\nipstr=split(ip,&quot;.&quot;)&nbsp; <br \/>\nallow1=split(allowip1,&quot;.&quot;)&nbsp; <br \/>\nallow2=split(allowip2,&quot;.&quot;)&nbsp; <br \/>\nif&nbsp;cint(allow1(0))&gt;cint(allow2(0))&nbsp;then&nbsp;&rsquo;\u5224\u65adIP\u5730\u5740\u6bb5\u662f\u5426\u5408\u6cd5&nbsp; <br \/>\nresponse.write&nbsp;&quot;IP\u5730\u5740\u6bb5\u51fa\u9519\uff01&quot;&nbsp; <br \/>\nexit&nbsp;function&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nfor&nbsp;i=0&nbsp;to&nbsp;ubound(ipstr)&nbsp; <br \/>\nif&nbsp;cint(allow1(i))&lt;cint(allow2(i))&nbsp;then&nbsp; <br \/>\nif&nbsp;cint(allow1(i))=cint(ipstr(i))&nbsp;then&nbsp; <br \/>\ncheck(i)=true&nbsp; <br \/>\ncheckip=true&nbsp; <br \/>\nexit&nbsp;for&nbsp; <br \/>\nelse&nbsp; <br \/>\nif&nbsp;cint(ipstr(i))&lt;cint(allow2(i))&nbsp;then&nbsp; <br \/>\ncheck(i)=true&nbsp; <br \/>\ncheckip=true&nbsp; <br \/>\nexit&nbsp;for&nbsp; <br \/>\nelse&nbsp; <br \/>\nif&nbsp;cint(ipstr(i))&gt;cint(allow2(i))&nbsp;then&nbsp; <br \/>\ncheck(i)=false&nbsp; <br \/>\ncheckip=false&nbsp; <br \/>\nexit&nbsp;for&nbsp; <br \/>\nelse&nbsp; <br \/>\ncheck(i)=true&nbsp; <br \/>\ncheckip=true&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nelse&nbsp; <br \/>\nif&nbsp;cint(allow1(i))&gt;cint(ipstr(i))&nbsp;or&nbsp;cint(allow1(i))&lt;cint(ipstr(i))&nbsp;then&nbsp; <br \/>\ncheck(i)=false&nbsp; <br \/>\ncheckip=false&nbsp; <br \/>\nif&nbsp;i&lt;&gt;ubound(ipstr)&nbsp;then&nbsp; <br \/>\nexit&nbsp;for&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nelse&nbsp; <br \/>\ncheck(i)=true&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nnext&nbsp; <\/p>\n<p>if&nbsp;(check(0)=true&nbsp;and&nbsp;check(1)=true&nbsp;and&nbsp;check(2)=true&nbsp;and&nbsp;check(3)=false)&nbsp;and&nbsp;(cint(allow2(2))&gt;cint(ipstr(2)))&nbsp;then&nbsp; <br \/>\ncheckip=true&nbsp; <br \/>\nend&nbsp;if&nbsp; <\/p>\n<p>end&nbsp;function&nbsp; <br \/>\n%&gt;&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u770b\u4e86\u4e00\u4e9bIP\u9650\u5236\u7684\u51fd\u6570\uff0c\u89c9\u5f97\u592a\u590d\u6742\u3002\u6240\u4ee5\uff0c\u8bd5\u7740\u5199\u4e86\u4e00\u4e2a\uff0c\u6bd4\u8f83\u7b80\u5355\u3002\u8bf7\u7f51\u53cb\u53c2\u8003\u6307\u6559\u3002\u8c22\u8c22\uff01\uff5e&nbsp; \u4ee3\u7801\u62f7\u8d1d\u6846&nbsp; &lt;%&nbsp; &rsquo;\u83b7\u53d6\u8bbf\u95ee\u8005\u7684\u5730\u5740&nbsp; ip=Request.ServerVaria&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-200","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=200"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":66063,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/200\/revisions\/66063"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=200"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}