{"id":641,"date":"2010-11-09T14:44:52","date_gmt":"2010-11-09T06:44:52","guid":{"rendered":""},"modified":"2014-03-11T22:34:04","modified_gmt":"2014-03-11T14:34:04","slug":"asp%e5%b8%b8%e7%94%a8%e9%80%9a%e7%94%a8%e5%87%bd%e6%95%b0%e4%b9%8bcookie%e9%98%b2%e4%b9%b1%e7%a0%81","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2010\/11\/09\/641.htm","title":{"rendered":"Asp\u5e38\u7528\u901a\u7528\u51fd\u6570\u4e4bCookie\u9632\u4e71\u7801"},"content":{"rendered":"<p>&nbsp;&#8216;\u51fd\u6570\u540d\uff1aCodeCookie <br \/>\n&nbsp; &#8216;\u4f5c \u7528\uff1aCookie\u9632\u4e71\u7801\u5199\u5165\u65f6\u7528 <br \/>\n&nbsp; &#8216;\u53c2 \u6570\uff1astr &#8212;- \u5b57\u7b26\u4e32 <br \/>\n&nbsp; &#8216;\u8fd4\u56de\u503c\uff1a\u6574\u7406\u540e\u7684\u5b57\u7b26\u4e32 <br \/>\n&nbsp; &#8216;\u793a \u4f8b\uff1a <br \/>\n&nbsp; &#8216;************************************************** <br \/>\n&nbsp; Public Function CodeCookie(str) <br \/>\n&nbsp;&nbsp; If isNumeric(str) Then str=Cstr(str) <br \/>\n&nbsp;&nbsp; Dim newstr <br \/>\n&nbsp;&nbsp; newstr=&quot;&quot; <br \/>\n&nbsp;&nbsp; For i=1 To Len(str) <br \/>\n&nbsp;&nbsp; newstr=newstr &amp; ascw(mid(str,i,1)) <br \/>\n&nbsp;&nbsp; If i&lt;&gt; Len(str) Then newstr= newstr &amp; &quot;a&quot; <br \/>\n&nbsp;&nbsp; Next <br \/>\n&nbsp;&nbsp; CodeCookie=newstr <br \/>\n&nbsp; End Function <br \/>\n&nbsp; &#8216;************************************************** <br \/>\n&#8216;\u51fd\u6570\u540d\uff1aDecodeCookie <br \/>\n&nbsp; &#8216;\u4f5c \u7528\uff1aCookie\u9632\u4e71\u7801\u8bfb\u51fa\u65f6\u7528 <br \/>\n&nbsp; &#8216;\u53c2 \u6570\uff1astr &#8212;- \u5b57\u7b26\u4e32 <br \/>\n&nbsp; &#8216;\u8fd4\u56de\u503c\uff1a\u6574\u7406\u540e\u7684\u5b57\u7b26\u4e32 <br \/>\n&nbsp; &#8216;\u793a \u4f8b\uff1a <br \/>\n&nbsp; &#8216;************************************************** <br \/>\n&nbsp; Public Function DecodeCookie(str) <br \/>\n&nbsp;&nbsp; DecodeCookie=&quot;&quot; <br \/>\n&nbsp;&nbsp; Dim newstr <br \/>\n&nbsp;&nbsp; newstr=Split(str,&quot;a&quot;) <br \/>\n&nbsp;&nbsp; For i = LBound(newstr) To UBound(newstr) <br \/>\n&nbsp;&nbsp; DecodeCookie= DecodeCookie &amp; chrw(newstr(i)) <br \/>\n&nbsp;&nbsp; Next <br \/>\n&nbsp; End Function<\/p>\n<p>&nbsp;&#8216;\u51fd\u6570\u540d\uff1aCodeCookie <br \/>\n&nbsp; &#8216;\u4f5c \u7528\uff1aCookie\u9632\u4e71\u7801\u5199\u5165\u65f6\u7528 <br \/>\n&nbsp; &#8216;\u53c2 \u6570\uff1astr &#8212;- \u5b57\u7b26\u4e32 <br \/>\n&nbsp; &#8216;\u8fd4\u56de\u503c\uff1a\u6574\u7406\u540e\u7684\u5b57\u7b26\u4e32 <br \/>\n&nbsp; &#8216;\u793a \u4f8b\uff1a <br \/>\n&nbsp; &#8216;************************************************** <br \/>\n&nbsp; Public Function CodeCookie(str) <br \/>\n&nbsp;&nbsp; If isNumeric(str) Then str=Cstr(str) <br \/>\n&nbsp;&nbsp; Dim newstr <br \/>\n&nbsp;&nbsp; newstr=&quot;&quot; <br \/>\n&nbsp;&nbsp; For i=1 To Len(str) <br \/>\n&nbsp;&nbsp; newstr=newstr &amp; ascw(mid(str,i,1)) <br \/>\n&nbsp;&nbsp; If i&lt;&gt; Len(str) Then newstr= newstr &amp; &quot;a&quot; <br \/>\n&nbsp;&nbsp; Next <br \/>\n&nbsp;&nbsp; CodeCookie=newstr <br \/>\n&nbsp; End Function <br \/>\n&nbsp; &#8216;************************************************** <br \/>\n&#8216;\u51fd\u6570\u540d\uff1aDecodeCookie <br \/>\n&nbsp; &#8216;\u4f5c \u7528\uff1aCookie\u9632\u4e71\u7801\u8bfb\u51fa\u65f6\u7528 <br \/>\n&nbsp; &#8216;\u53c2 \u6570\uff1astr &#8212;- \u5b57\u7b26\u4e32 <br \/>\n&nbsp; &#8216;\u8fd4\u56de\u503c\uff1a\u6574\u7406\u540e\u7684\u5b57\u7b26\u4e32 <br \/>\n&nbsp; &#8216;\u793a \u4f8b\uff1a <br \/>\n&nbsp; &#8216;************************************************** <br \/>\n&nbsp; Public Function DecodeCookie(str) <br \/>\n&nbsp;&nbsp; DecodeCookie=&quot;&quot; <br \/>\n&nbsp;&nbsp; Dim newstr <br \/>\n&nbsp;&nbsp; newstr=Split(str,&quot;a&quot;) <br \/>\n&nbsp;&nbsp; For i = LBound(newstr) To UBound(newstr) <br \/>\n&nbsp;&nbsp; DecodeCookie= DecodeCookie &amp; chrw(newstr(i)) <br \/>\n&nbsp;&nbsp; Next <br \/>\n&nbsp; End Function <br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&#8216;\u51fd\u6570\u540d\uff1aCodeCookie &nbsp; &#8216;\u4f5c \u7528\uff1aCookie\u9632\u4e71\u7801\u5199\u5165\u65f6\u7528 &nbsp; &#8216;\u53c2 \u6570\uff1astr &#8212;- \u5b57\u7b26\u4e32 &nbsp; &#8216;\u8fd4\u56de\u503c\uff1a\u6574\u7406\u540e\u7684\u5b57\u7b26\u4e32&#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-641","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/641","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=641"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/641\/revisions"}],"predecessor-version":[{"id":66487,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/641\/revisions\/66487"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=641"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=641"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}