{"id":285,"date":"2006-03-12T10:03:16","date_gmt":"2006-03-12T02:03:16","guid":{"rendered":"http:\/\/fdream.net\/blog\/article\/285.aspx"},"modified":"2006-03-26T17:03:16","modified_gmt":"2006-03-26T09:03:16","slug":"%e7%a6%81%e6%ad%a2%e6%9f%90%e4%ba%9bIP%e8%ae%bf%e9%97%ae%e7%bd%91%e7%ab%99","status":"publish","type":"post","link":"https:\/\/fdream.net\/blog\/article\/285","title":{"rendered":"\u7981\u6b62\u67d0\u4e9bIP\u8bbf\u95ee\u7f51\u7ad9"},"content":{"rendered":"<p>\u5076\u5c14\u4f1a\u6709\u4e00\u4e9b\u5f88\u4ee4\u4eba\u8ba8\u538c\u7684\u4eba\u8bbf\u95ee\u4f60\u7684\u7f51\u7ad9\uff0c\u6ca1\u529e\u6cd5\uff0c\u5c01IP\u5427\u2026\u2026<\/p>\n<p>\u4e00\u4e2a\u7b80\u5355\u7684\u5c01\u5c11\u91cfIP\u7684ASP\u4ee3\u7801\uff1a<\/p>\n<blockquote>\n<p><%<br \/>Dim IP,IPString,VisitIP<br \/>&#8216;\u8981\u7981\u6b62\u7684IP\u5730\u5740<br \/>IPString=&#8221;|219.142.118.71|127.0.0.1|&#8221;<br \/>&#8216;\u83b7\u53d6IP\u5730\u5740<br \/>IP = Request.ServerVariables(&#8220;HTTP_X_FORWARDED_FOR&#8221;)<br \/>If IP = &#8220;&#8221; Then\t <br \/>IP = Request.ServerVariables(&#8220;REMOTE_ADDR&#8221;)<br \/>End If<br \/>VisitIP=&#8221;|&#8221;&#038;IP&#038;&#8221;|&#8221;<br \/>If instr(1,IPString,VisitIP)>0 Then <br \/>response.write &#8220;\u4f60\u7684IP\u88ab\u7981\u6b62&#8221;<br \/>response.end<br \/>End If<br \/>response.Write(&#8220;\u4f60\u7684IP:&#8221;&#038;IP&#038;&#8221;\u53ef\u4ee5\u8bbf\u95ee\u672c\u7ad9&#8221;)<br \/>%><\/p>\n<\/blockquote>\n<p>[#afdream.com#]<br \/>\u7981\u6b62\u67d0\u4e2aIP\u6bb5\u8bbf\u95ee\uff1a<\/p>\n<blockquote>\n<p><%<br \/>Dim IP,forbidIP1,forbidIP2,isForbid<br \/>&#8221;\u83b7\u53d6\u8bbf\u95ee\u8005\u7684\u5730\u5740<br \/>IP = Request.ServerVariables(&#8220;HTTP_X_FORWARDED_FOR&#8221;)<br \/>If IP = &#8220;&#8221; Then     <br \/>IP = Request.ServerVariables(&#8220;REMOTE_ADDR&#8221;)<br \/>End If<\/p>\n<p>&#8221;\u7981\u6b62\u7684IP\u5730\u5740\u6bb5\u4e3a220.191.0.0\uff5e220.191.255.255<br \/>forbidIP1=&#8221;220.191.0.0&#8243;<br \/>forbidIP2=&#8221;220.191.255.255&#8243;<br \/>isForbid=CheckIP(IP,forbidIP1,forbidIP2)<br \/>If isForbid=true Then<br \/>\tresponse.Write(&#8220;\u7981\u6b62\u8bbf\u95ee\uff01&#8221;)<br \/>\tresponse.End()<br \/>End IF<br \/>Response.Write(IP)<\/p>\n<p>Function CheckIP(IP,forbidIP1,forbidIP2)<br \/>\tDim IPString,forbid1,forbid2,forbid<br \/>\tforbid=false<br \/>\tIPString=split(IP,&#8221;.&#8221;)<br \/>\tforbid1=split(forbidIP1,&#8221;.&#8221;)<br \/>\tforbid2=split(forbidIP2,&#8221;.&#8221;)<br \/>\tIf cint(IPString(0))>cint(forbid1(0)) And cint(IPString(0))<cint(forbid2(0)) Then ''\u5224\u65adIP\u5730\u5740\u6bb5\u662f\u5426\u5408\u6cd5<br \/>\t\tforbid=true<br \/>\tElseIF cint(IPString(1))>cint(forbid1(1)) And cint(IPString(1))<cint(forbid2(1)) Then<br \/>\t\tforbid=true<br \/>\tElseIF cint(IPString(2))>cint(forbid1(2)) And cint(IPString(2))<cint(forbid2(2)) Then<br \/>\t\tforbid=true<br \/>\tElseIF cint(IPString(3))>=cint(forbid1(3)) And cint(IPString(3))<=cint(forbid2(3)) Then<br \/>\t\tforbid=true<br \/>\tEnd IF<br \/>End Function<br \/>%><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u5076\u5c14\u4f1a\u6709\u4e00\u4e9b\u5f88\u4ee4\u4eba\u8ba8\u538c\u7684\u4eba\u8bbf\u95ee\u4f60\u7684\u7f51\u7ad9\uff0c\u6ca1\u529e\u6cd5\uff0c\u5c01IP\u5427\u2026\u2026 \u4e00\u4e2a\u7b80\u5355\u7684\u5c01\u5c11\u91cfIP\u7684ASP\u4ee3\u7801\uff1a 0 Then response.write &#8220;\u4f60\u7684IP\u88ab\u7981\u6b62&#8221;response.endEnd Ifresponse.Write(&#8220;\u4f60\u7684IP:&#8221;&#038;IP&#038;&#8221;\u53ef\u4ee5\u8bbf\u95ee\u672c\u7ad9&#8221;)%> [#afdream.com#]\u7981\u6b62\u67d0\u4e2aIP\u6bb5\u8bbf\u95ee\uff1a cint(forbid1(0)) And cint(IPString(0))cint(forbid1(1)) And cint(IPString(1))cint(forbid1(2)) And cint(IPString(2))=cint(forbid1(3)) And cint(IPString(3))<\/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":[25,26],"class_list":["post-285","post","type-post","status-publish","format-standard","hentry","category-coding","tag-ASP","tag-26"],"views":13349,"_links":{"self":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts\/285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/comments?post=285"}],"version-history":[{"count":0,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts\/285\/revisions"}],"wp:attachment":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/media?parent=285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/categories?post=285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/tags?post=285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}