{"id":750,"date":"2011-11-09T16:10:44","date_gmt":"2011-11-09T08:10:44","guid":{"rendered":""},"modified":"2014-03-11T22:40:06","modified_gmt":"2014-03-11T14:40:06","slug":"%e5%8a%a8%e6%80%81%e7%a8%8b%e5%ba%8f%e9%98%b2%e9%87%87%e9%9b%86%e7%9a%84%e6%96%b0%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2011\/11\/09\/750.htm","title":{"rendered":"\u52a8\u6001\u7a0b\u5e8f\u9632\u91c7\u96c6\u7684\u65b0\u65b9\u6cd5"},"content":{"rendered":"<p>\u5728\u7f51\u4e0a\u770b\u5230\u4e00\u4e2a\u9632\u91c7\u96c6\u8f6f\u4ef6\uff0c\u8bf4\u91c7\u96c6\u53ea\u8bbf\u95ee\u5f53\u524d\u7f51\u9875\uff0c\u4e0d\u4f1a\u8bbf\u95ee\u7f51\u9875\u7684\u56fe\u7247\u3001JS\u7b49\uff0c\u4eca\u5929\u7a81\u7136\u60f3\u5230\uff0c\u901a\u8fc7\u52a8\u6001\u7a0b\u5e8f\u548cJs\u8bbf\u95ee\u5206\u522b\u8bb0\u5f55\u8bbf\u95ee\u8005\u7684IP\uff0c\u7136\u540e\u8fdb\u884cIP\u5224\u65ad\uff0c\u7531\u4e8e\u91c7\u96c6\u8fc7\u7a0b\u4e0d\u4f1a\u8bbf\u95eeJS\uff0c\u91c7\u96c6\u7684\u65f6\u5019\u53ea\u4f1a\u67e5\u5230\u7528\u52a8\u6001\u7a0b\u5e8f\u8bb0\u5f55\u7684IP\uff0c\u800c\u4e0d\u4f1a\u6709\u901a\u8fc7JS\u8bb0\u5f55\u7684IP\uff0c\u4ece\u800c\u5b9e\u73b0\u7f51\u9875\u7a0b\u5e8f\u7684\u9632\u91c7\u96c6\u3002<\/p>\n<p>\u9632\u91c7\u96c6\u7684\u539f\u7406\u975e\u5e38\u7b80\u5355\uff0c\u9996\u5148\u653e\u4e00\u6bb5\u52a8\u6001\u8bed\u53e5\uff0c\u628a\u8bbf\u95ee\u8005\u7684IP\u52a0\u5165\u5230\u6570\u636e\u5e93\u7684\u4e00\u4e2a\u8868\u91cc\uff0c\u7136\u540e\u5728\u9875\u9762\u5e95\u90e8\u52a0\u5165\u4e00\u4e2aJS\uff0cJS\u76f4\u63a5\u8bbf\u95ee\u52a8\u6001\u9875\u9762\uff0c\u5c06\u8bbf\u95ee\u8005\u7684IP\u52a0\u5165\u5230\u6570\u636e\u5e93\u7684\u53e6\u5916\u4e00\u4e2a\u8868\u91cc\u3002\u518d\u6b21\u8bbf\u95ee\u7684\u65f6\u5019\uff0c\u4ece\u4e24\u4e2a\u8868\u91cc\u8bfbIP\u6570\u636e\uff0c\u7136\u540e\u5224\u65ad\u65f6\u95f4\u5dee\uff0c\u5982\u679c\u53ea\u5728\u7b2c\u4e00\u4e2a\u8868\u91cc\u627e\u5230\uff0c\u5728\u7b2c\u4e8c\u4e2a\u8868\u91cc\u627e\u4e0d\u5230\uff0c\u6216\u8005\u65f6\u95f4\u5dee\u8d85\u8fc710\u79d2\uff0c\u5219\u8ba4\u4e3a\u662f\u91c7\u96c6\u3002<\/p>\n<p style=\"font-weight: bold\">\u4f18\u70b9<\/p>\n<p>1.\u90e8\u7f72\u7b80\u5355\uff0c\u53ea\u8981\u662f\u52a8\u6001\u8bed\u8a00\u5c31\u80fd\u5f88\u5bb9\u6613\u7684\u5b9e\u73b0\uff0c\u65e0\u9700\u501f\u52a9\u670d\u52a1\u5668\u7aef\u7a0b\u5e8f<\/p>\n<p>2.\u6740\u4f24\u529b\u5927\uff0c\u51e0\u4e4e\u80fd\u5c01\u6740\u6240\u6709\u7684\u91c7\u96c6\u8fc7\u7a0b<\/p>\n<p style=\"font-weight: bold\">\u7f3a\u70b9<\/p>\n<p>1.\u7b2c\u4e00\u4e2a\u7f3a\u70b9\u8fd8\u662f\u6740\u4f24\u529b\u5927\uff0c\u5982\u679c\u9700\u8981\u5b9e\u9645\u4f7f\u7528\u9700\u8981\u8003\u8651\u4e00\u4e9b\u7279\u6b8a\u60c5\u51b5\uff0c\u4ee5\u514d\u8bef\u6740\u5df2\u7ecf\u6740\u6389\u641c\u7d22\u722c\u866b<\/p>\n<p>2.\u53ea\u9002\u7528\u4e8e\u52a8\u6001\u7f51\u9875\uff0c\u9759\u6001\u9875\u9762\u5c31\u6ca1\u6cd5\u7528\u4e86<\/p>\n<p style=\"font-weight: bold\">\u6d41\u7a0b\u5199\u7684\u6bd4\u8f83\u4e71\uff0c\u4e0d\u8fc7\u539f\u7406\u672c\u8eab\u5c31\u4e0d\u662f\u5f88\u590d\u6742\uff0c\u4e0b\u9762\u9644\u4e0a\u7a0b\u5e8f\u4f8b\u5b50\uff0c\u61c2ASP\u7684\u5e94\u8be5\u5f88\u5feb\u5c31\u80fd\u770b\u61c2\u3002<\/p>\n<p style=\"font-weight: bold\">\u672c\u6587\u7531\u65b9\u5361\u5728\u7ebf(http:\/\/www.fangka.net\/)\u539f\u521b\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002\u5982\u6709\u96f7\u540c\uff0c\u7eaf\u5c5e\u5de7\u5408\uff01<\/p>\n<p>\u7a0b\u5e8f\u4f8b\u5b50\uff08ASP+ACCESS\uff09\uff1a<\/p>\n<p>1.\u5efa\u7acb\u6570\u636e\u5e93<\/p>\n<p>\u88681\uff1aIp1\uff0c\u5b57\u6bb5Ip1_Adderss\uff08\u6587\u672c\uff09\uff0cIp1_Time\uff08\u65e5\u671f\/\u65f6\u95f4\uff0c\u9ed8\u8ba4\u503c=Now()\uff09<\/p>\n<p>\u88682\uff1aIp2\uff0c\u5b57\u6bb5Ip2_Adderss\uff08\u6587\u672c\uff09\uff0cIp2_Time\uff08\u65e5\u671f\/\u65f6\u95f4\uff0c\u9ed8\u8ba4\u503c=Now()\uff09<\/p>\n<p>2.Index.asp\uff08\u4ec5\u52a8\u6001\u4ee3\u7801\uff0c\u5168\u90e8\u4ee3\u7801\u8bf7\u89c1\u6d4b\u8bd5\u7a0b\u5e8f\u4e2d\uff09<\/p>\n<p style=\"border-right: #0099cc 1px solid; padding-right: 10px; border-top: #0099cc 1px solid; padding-left: 10px; padding-bottom: 10px; border-left: #0099cc 1px solid; text-indent: 0px; padding-top: 10px; border-bottom: #0099cc 1px solid; background-color: #ddedfb\">&lt;%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;936&quot;%&gt;<br \/>\n&lt;%<br \/>\nDim Conn,Rs,Sqlstr,Ip,IpTime,IpTime2,NewUser<br \/>\nNewUser=0<br \/>\nSet Conn = Server.CreateObject(&quot;Adodb.Connection&quot;)<br \/>\nSet Rs=Server.Createobject(&quot;Adodb.RecordSet&quot;)<br \/>\nConnStr=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; &amp; Server.MapPath(&quot;Data.mdb&quot;)<br \/>\nConn.Open ConnStr<br \/>\nIp=Request.ServerVariables(&quot;REMOTE_ADDR&quot;)<br \/>\nSqlstr=&quot;Select * From [Ip1] Where Ip1_Address=&#8217;&quot;&amp;Ip&amp;&quot;&#8217; Order By Ip1_Id Desc&quot;<br \/>\nRs.Open Sqlstr,Conn,1,3<br \/>\nIf Rs.Eof Then<br \/>\nNewUser=1<br \/>\nApplication.Lock()<br \/>\nRs.AddNew()<br \/>\nRs(&quot;Ip1_Address&quot;)=Ip<br \/>\nRs.Update()<br \/>\nApplication.UnLock()<br \/>\nElse<br \/>\nIpTime=Rs(&quot;Ip1_Time&quot;)<br \/>\nApplication.Lock()<br \/>\nRs.AddNew()<br \/>\nRs(&quot;Ip1_Address&quot;)=Ip<br \/>\nRs.Update()<br \/>\nApplication.UnLock()<br \/>\nEnd If<br \/>\nRs.Close<br \/>\nIf NewUser=0 Then<br \/>\nSqlstr=&quot;Select * From [Ip2] Where Ip2_Address=&#8217;&quot;&amp;Ip&amp;&quot;&#8217; Order By Ip2_Id Desc&quot;<br \/>\nRs.Open Sqlstr,Conn,1,3<br \/>\nIf Rs.Eof Then<br \/>\nRs.Close<br \/>\nResponse.Write(&quot;\u8bf7\u52ff\u91c7\u96c6\uff01&quot;)<br \/>\nResponse.End()<br \/>\nElse<br \/>\nIpTime2=Rs(&quot;Ip2_Time&quot;)<br \/>\nIf DateDiff(&quot;s&quot;,IpTime2,IpTime)&gt;10 Then<br \/>\nRs.Close<br \/>\nResponse.Write(&quot;\u8bf7\u52ff\u91c7\u96c6\uff01&quot;)<br \/>\nResponse.End()<br \/>\nEnd If<br \/>\nEnd If<br \/>\nRs.Close<br \/>\nEnd If<br \/>\n%&gt;<br \/>\n&nbsp;<\/p>\n<p>3.Js.asp<\/p>\n<p style=\"border-right: #0099cc 1px solid; padding-right: 10px; border-top: #0099cc 1px solid; padding-left: 10px; padding-bottom: 10px; border-left: #0099cc 1px solid; text-indent: 0px; padding-top: 10px; border-bottom: #0099cc 1px solid; background-color: #ddedfb\">&lt;%<br \/>\nDim Conn,Rs,Sqlstr,Ip<br \/>\nSet Conn = Server.CreateObject(&quot;Adodb.Connection&quot;)<br \/>\nSet Rs=Server.Createobject(&quot;Adodb.RecordSet&quot;)<br \/>\nConnStr=&quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; &amp; Server.MapPath(&quot;Data.mdb&quot;)<br \/>\nConn.Open ConnStr<br \/>\nIp=Request.ServerVariables(&quot;REMOTE_ADDR&quot;)<br \/>\nSqlstr=&quot;Select * From [Ip2]&quot;<br \/>\nRs.Open Sqlstr,Conn,1,3<br \/>\nApplication.Lock()<br \/>\nRs.AddNew()<br \/>\nRs(&quot;Ip2_Address&quot;)=Ip<br \/>\nRs.Update()<br \/>\nApplication.UnLock()<br \/>\nRs.Close<br \/>\n%&gt;<\/p>\n<p>4.Get.asp<\/p>\n<p style=\"border-right: #0099cc 1px solid; padding-right: 10px; border-top: #0099cc 1px solid; padding-left: 10px; padding-bottom: 10px; border-left: #0099cc 1px solid; text-indent: 0px; padding-top: 10px; border-bottom: #0099cc 1px solid; background-color: #ddedfb\">&lt;%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;936&quot;%&gt;<br \/>\n&lt;%<br \/>\nResponse.Write(Server.HTMLEncode(GetHttpPage(&quot;http:\/\/localxiaoyebailong.com\/Index.asp&quot;,&quot;GB2312&quot;)))<br \/>\n&#8216;==============================<br \/>\n&#8216;\u51fd \u6570 \u540d\uff1aGetHttpPage<br \/>\n&#8216;\u4f5c \u7528\uff1a\u83b7\u53d6\u9875\u9762\u6e90\u4ee3\u7801\u51fd\u6570<br \/>\n&#8216;\u53c2 \u6570\uff1a\u7f51\u5740HttpUrl<br \/>\n&#8216;==============================<br \/>\nFunction GetHttpPage(HttpUrl,Code)<br \/>\nIf IsNull(HttpUrl)=True Or HttpUrl=&quot;&quot; Then<br \/>\nGetHttpPage=&quot;A\u7ad9\u70b9\u7ef4\u62a4\u4e2d\uff01&quot;<br \/>\nExit Function<br \/>\nEnd If<br \/>\nOn Error Resume Next<br \/>\nDim Http<br \/>\nSet Http=server.createobject(&quot;MSX&quot;&amp;&quot;ML2.XML&quot;&amp;&quot;HTTP&quot;)<br \/>\nHttp.open &quot;GET&quot;,HttpUrl,False<br \/>\nHttp.Send()<br \/>\nIf Http.Readystate&lt;&gt;4 then<br \/>\nSet Http=Nothing<br \/>\nGetHttpPage=&quot;B\u7ad9\u70b9\u7ef4\u62a4\u4e2d\uff01&quot;<br \/>\nExit function<br \/>\nEnd if<br \/>\nGetHttpPage=BytesToBSTR(Http.responseBody,Code)<br \/>\nSet Http=Nothing<br \/>\nIf Err.number&lt;&gt;0 then<br \/>\nErr.Clear<br \/>\nGetHttpPage=&quot;C\u7ad9\u70b9\u7ef4\u62a4\u4e2d\uff01&quot;<br \/>\nExit function<br \/>\nEnd If<br \/>\nEnd Function<br \/>\n&#8216;==============================<br \/>\n&#8216;\u51fd \u6570 \u540d\uff1aBytesToBstr<br \/>\n&#8216;\u4f5c \u7528\uff1a\u8f6c\u6362\u7f16\u7801\u51fd\u6570<br \/>\n&#8216;\u53c2 \u6570\uff1a\u5b57\u7b26\u4e32Body\uff0c\u7f16\u7801Cset<br \/>\n&#8216;==============================<br \/>\nFunction BytesToBstr(Body,Cset)<br \/>\nDim Objstream<br \/>\nSet Objstream = Server.CreateObject(&quot;ado&quot;&amp;&quot;d&quot;&amp;&quot;b.st&quot;&amp;&quot;re&quot;&amp;&quot;am&quot;)<br \/>\nObjstream.Type = 1<br \/>\nObjstream.Mode =3<br \/>\nObjstream.Open<br \/>\nObjstream.Write body<br \/>\nObjstream.Position = 0<br \/>\nObjstream.Type = 2<br \/>\nObjstream.Charset = Cset<br \/>\nBytesToBstr = Objstream.ReadText <br \/>\nObjstream.Close<br \/>\nset Objstream = nothing<br \/>\nEnd Function<br \/>\n%&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u7f51\u4e0a\u770b\u5230\u4e00\u4e2a\u9632\u91c7\u96c6\u8f6f\u4ef6\uff0c\u8bf4\u91c7\u96c6\u53ea\u8bbf\u95ee\u5f53\u524d\u7f51\u9875\uff0c\u4e0d\u4f1a\u8bbf\u95ee\u7f51\u9875\u7684\u56fe\u7247\u3001JS\u7b49\uff0c\u4eca\u5929\u7a81\u7136\u60f3\u5230\uff0c\u901a\u8fc7\u52a8\u6001\u7a0b\u5e8f\u548cJs\u8bbf\u95ee\u5206\u522b\u8bb0\u5f55\u8bbf\u95ee\u8005\u7684IP\uff0c\u7136\u540e\u8fdb\u884cIP\u5224\u65ad\uff0c\u7531\u4e8e\u91c7\u96c6\u8fc7\u7a0b\u4e0d\u4f1a\u8bbf\u95eeJS\uff0c\u91c7\u96c6\u7684\u65f6\u5019\u53ea\u4f1a\u67e5\u5230\u7528\u52a8\u6001\u7a0b\u5e8f\u8bb0\u5f55\u7684IP\uff0c\u800c\u4e0d\u4f1a\u6709\u901a\u8fc7JS\u8bb0\u5f55\u7684&#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-750","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/750","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=750"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/750\/revisions"}],"predecessor-version":[{"id":66611,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/750\/revisions\/66611"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=750"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=750"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=750"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=750"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}