{"id":687,"date":"2011-01-28T10:20:51","date_gmt":"2011-01-28T02:20:51","guid":{"rendered":""},"modified":"2014-03-11T22:36:59","modified_gmt":"2014-03-11T14:36:59","slug":"%e7%bd%91%e9%a1%b5%e9%98%b2%e9%87%87%e9%9b%86%e4%bb%a3%e7%a0%81aspjavascript","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2011\/01\/28\/687.htm","title":{"rendered":"\u7f51\u9875\u9632\u91c7\u96c6\u4ee3\u7801(asp,javascript)"},"content":{"rendered":"<p>\u9632\u6b62\u4e00\u822c\u7684\u91c7\u96c6\u4ee5\u53ca\u5c0f\u5077\u8bfb\u53d6\uff0c\u52a0\u5728\u9876\u90e8\u3002<br \/>\n\u65b9\u6cd5\u4e00\u3001\u9632\u91c7\u96c6\u7684asp\u4ee3\u7801<br \/>\n&lt;% <br \/>\nDim AppealNum,AppealCount <br \/>\nAppealNum=10 &#8216;\u540c\u4e00IP60\u79d2\u5185\u8bf7\u6c42\u9650\u523610\u6b21 <br \/>\nAppealCount=Request.Cookies(&quot;AppealCount&quot;) <br \/>\nIf AppealCount=&quot;&quot; Then <br \/>\nresponse.Cookies(&quot;AppealCount&quot;)=1 <br \/>\nAppealCount=1 <br \/>\nresponse.cookies(&quot;AppealCount&quot;).expires=dateadd(&quot;s&quot;,60,now()) <br \/>\nElse <br \/>\nresponse.Cookies(&quot;AppealCount&quot;)=AppealCount+1 <br \/>\nresponse.cookies(&quot;AppealCount&quot;).expires=dateadd(&quot;s&quot;,60,now()) <br \/>\nEnd If <br \/>\nif int(AppealCount)&gt;int(AppealNum) then <br \/>\nresponse.write &quot;\u6b47\u4e00\u4f1a\u513f\u5427\uff01\u6574\u5929\u91c7\u96c6\u4f60\u70e6\u4e0d\u70e6\u554a\uff01&quot; <br \/>\nresponse.end <br \/>\nEnd If <br \/>\n%&gt;<\/p>\n<p>\u65b9\u6cd5\u4e8c\u3001<\/p>\n<p>\n\u9632\u91c7\u96c6\u7684JS\u4ee3\u7801<\/p>\n<p>&lt;script language=&quot;JavaScript&quot; type=&quot;text\/javascript&quot;&gt;<br \/>\n\/\/ Example:<\/p>\n<p>\/\/ writeCookie(&quot;myCookie&quot;, &quot;my name&quot;, 24);<\/p>\n<p>\/\/ Stores the string &quot;my name&quot; in the cookie &quot;myCookie&quot; which expires after 24 hours.<\/p>\n<p>function writeCookie(name, value, hours)<\/p>\n<p>{<\/p>\n<p>var expire = &quot;&quot;;<\/p>\n<p>if(hours != null)<\/p>\n<p>{<\/p>\n<p>expire = new Date((new Date()).getTime() + hours * 3600000);<\/p>\n<p>expire = &quot;; expires=&quot; + expire.toGMTString();<\/p>\n<p>}<\/p>\n<p>document.cookie = name + &quot;=&quot; + escape(value) + expire;<\/p>\n<p>}<\/p>\n<p>\/\/ Example:<\/p>\n<p>\/\/ alert( readCookie(&quot;myCookie&quot;) );<\/p>\n<p>function readCookie(name)<\/p>\n<p>{<\/p>\n<p>var cookieValue = &quot;&quot;;<\/p>\n<p>var search = name + &quot;=&quot;;<\/p>\n<p>if(document.cookie.length &gt; 0)<\/p>\n<p>{ <\/p>\n<p>offset = document.cookie.indexOf(search);<\/p>\n<p>if (offset != -1)<\/p>\n<p>{ <\/p>\n<p>offset += search.length;<\/p>\n<p>end = document.cookie.indexOf(&quot;;&quot;, offset);<\/p>\n<p>if (end == -1) end = document.cookie.length;<\/p>\n<p>cookieValue = unescape(document.cookie.substring(offset, end))<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>return cookieValue;<\/p>\n<p>}<\/p>\n<p>\n&lt;\/script&gt; <\/p>\n<p>\u65b9\u6cd5\u4e09\u3001<\/p>\n<p>&lt;%<br \/>\n&#8216;\u4f5c\u7528:\u6587\u5b57\u9632\u590d\u5236\u4e71\u7801 \u51fd\u6570<br \/>\n&#8216;Date:2006-3-6<br \/>\n&#8216;\u53c2\u6570str \u4e3a\u539f\u6587,str1\u4f5c\u8005\u4e5f\u662f\u4f60\u81ea\u5df1,reslut\u4ea7\u751f\u4e71\u7801\u7684\u79cd\u5b50<br \/>\nFunction ReadToCode(str,Str1,result)<br \/>\ndim name<br \/>\ndim i,j,k<br \/>\nIf isnull(str) then<br \/>\nReadToCode=&quot;&quot;<br \/>\nExit Function<br \/>\nEnd If<br \/>\nRandomize <br \/>\nk=instr(str,&quot;&lt;\/P&gt;&quot;)<br \/>\nDo while k&gt;0<br \/>\nresult=&quot;&quot;<br \/>\nfor i=0 to 19<br \/>\nj=Int(128 * Rnd)+1<br \/>\nif j=60 or j=62 then<br \/>\nj=j+1<br \/>\nend if<br \/>\nresult =result&amp;chr(j) &#8216; \u4ea7\u751f\u968f\u673a\u6570\u3002<br \/>\nnext <br \/>\nresult=&quot;&lt;span style=&#8217;DISPLAY: none&#8217;&gt;&quot;&amp;result&amp;&quot;&lt;\/span&gt;&quot;<br \/>\nstr=replace(str,&quot;&lt;\/p&gt;&quot;,result&amp;&quot;&lt;&#8216;\/p&gt;&quot;,1,1)<br \/>\nk=instr(str,&quot;&lt;\/p&gt;&quot;)<br \/>\nloop<br \/>\nstr=replace(str,&quot;&lt;&#8216;\/p&gt;&quot;,&quot;&lt;\/p&gt;&quot;)<\/p>\n<p>k=instr(str,&quot;&lt;br&gt;&quot;)<br \/>\nDo while k&gt;0<br \/>\nresult=&quot;&quot;<br \/>\nfor i=0 to 19<br \/>\nj=Int(128 * Rnd)+1<br \/>\nif j=60 or j=62 then<br \/>\nj=j+1<br \/>\nend if<br \/>\nresult =result&amp;chr(j) &#8216; \u4ea7\u751f\u968f\u673a\u6570\u3002<br \/>\nnext <br \/>\nresult=&quot;&lt;span style=&#8217;DISPLAY: none&#8217;&gt;&quot;&amp;result&amp;&quot;&lt;\/span&gt;&quot;<br \/>\nstr=replace(str,&quot;&lt;br&gt;&quot;,result&amp;&quot;&lt;&#8216;br&gt;&quot;,1,1)<br \/>\nk=instr(str,&quot;&lt;br&gt;&quot;)<br \/>\nloop<br \/>\nstr=replace(str,&quot;&lt;&#8216;br&gt;&quot;,&quot;&lt;br&gt;&quot;)<br \/>\nReadToCode=str&amp;&quot;&lt;div align=right style=&#8217;color=gray&#8217;&gt;[\u7248\u6743\u5f52\u539f\u4f5c\u8005\u53ca&quot;&amp;Str1&amp;&quot;\u5171\u540c\u62e5\u6709\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904]&lt;\/div&gt;&quot;<br \/>\nEnd Function<\/p>\n<p>\n&#8216;Dim a <br \/>\na=&quot;&lt;p&gt;\u560e\u560e&lt;br&gt;\u4e00\u7bc7\u4e0d\u9519\u7684\u597d\u6587\u7ae0\u54e6&lt;\/p&gt;&quot;<\/p>\n<p>&#8216;Only For Test<br \/>\n&#8216;response.write (a)<\/p>\n<p>Dim b<br \/>\n&#8216;\u4e3a\u914d\u5408\u8f6c\u6362,\u5b57\u7b26\u4e32\uff41\u7684\u5927\u5c0f\u90fd\u66ff\u6362\u6210\u5c0f\u5199<br \/>\nb=ReadToCode(LCase(a),&quot;\u672c\u7f51&quot;,&quot;www.yiqixue.com&quot;)<\/p>\n<p>&#8216;Output<br \/>\nresponse.write b<br \/>\n%&gt;<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9632\u6b62\u4e00\u822c\u7684\u91c7\u96c6\u4ee5\u53ca\u5c0f\u5077\u8bfb\u53d6\uff0c\u52a0\u5728\u9876\u90e8\u3002 \u65b9\u6cd5\u4e00\u3001\u9632\u91c7\u96c6\u7684asp\u4ee3\u7801 &lt;% Dim AppealNum,AppealCount AppealNum=10 &#8216;\u540c\u4e00IP60\u79d2\u5185\u8bf7\u6c42\u9650\u523610\u6b21 AppealCount=Reques&#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-687","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/687","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=687"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/687\/revisions"}],"predecessor-version":[{"id":66555,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/687\/revisions\/66555"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=687"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=687"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}