{"id":31,"date":"2008-10-29T13:07:45","date_gmt":"2008-10-29T05:07:45","guid":{"rendered":""},"modified":"2014-02-27T22:52:57","modified_gmt":"2014-02-27T14:52:57","slug":"asp%e7%94%9f%e6%88%90%e9%9a%8f%e6%9c%ba%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%95%b0%e5%ad%97%e5%a4%a7%e5%b0%8f%e5%86%99%e5%ad%97%e6%af%8d","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2008\/10\/29\/31.htm","title":{"rendered":"ASP\u751f\u6210\u968f\u673a\u5b57\u7b26\u4e32(\u6570\u5b57+\u5927\u5c0f\u5199\u5b57\u6bcd)"},"content":{"rendered":"<p><span style=\"color: #000000\">\u4e24\u79cd\u5199\u6cd5\u90fd\u4e00\u6837\u5176\u5b9e\u5c31\u662f\u8f93\u51fa\u4e0d\u4e00\u6837\uff01<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #000000\">\u7b2c\u4e00\u79cd\uff0813\u4f4d\u968f\u673a\u6570\u6570\u5b57+\u5927\u5c0f\u5199\u5b57\u6bcd\uff09<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000080\">&lt;%<br \/>\nFunction gen_key(digits)<br \/>\n&#8216;\u5b9a\u4e49\u5e76\u521d\u59cb\u5316\u6570\u7ec4<br \/>\n&nbsp;&nbsp;&nbsp; dim char_array(80)<br \/>\n&nbsp;&#8216;\u521d\u59cb\u5316\u6570\u5b57<br \/>\n&nbsp;&nbsp;&nbsp; For i = 0 To 9<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char_array(i) = CStr(i)<br \/>\n&nbsp;&nbsp;&nbsp; Next<br \/>\n&nbsp;&#8216;\u521d\u59cb\u5316\u5927\u5199\u5b57\u6bcd<br \/>\n&nbsp;&nbsp;&nbsp; For i = 10 To 35<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char_array(i) = Chr(i + 55)<br \/>\n&nbsp;&nbsp;&nbsp; Next<br \/>\n&nbsp;&#8216;\u521d\u59cb\u5316\u5c0f\u5199\u5b57\u6bcd<br \/>\n&nbsp;&nbsp;&nbsp; For i = 36 To 61<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char_array(i) = Chr(i + 61)<br \/>\n&nbsp;&nbsp;&nbsp; Next<br \/>\n&nbsp;Randomize&nbsp;&nbsp; &#8216;\u521d\u59cb\u5316\u968f\u673a\u6570\u751f\u6210\u5668\u3002<br \/>\n&nbsp;do while len(output) &lt; digits<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; num = char_array(Int((62 &#8211; 0 + 1) * Rnd + 0))<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; output = output + num<br \/>\n&nbsp;&nbsp;&nbsp; loop<br \/>\n&#8216;\u8bbe\u7f6e\u8fd4\u56de\u503c<br \/>\n&nbsp;&nbsp;&nbsp; gen_key&nbsp;&nbsp;&nbsp; =&nbsp;&nbsp;&nbsp; output<br \/>\nEnd Function<br \/>\n&#8216;\u628a\u7ed3\u679c\u8fd4\u56de\u7ed9\u6d4f\u89c8\u5668<br \/>\nresponse.write gen_key(13)<br \/>\n%&gt;<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000000\"><span><strong>\u7b2c2\u79cd\uff086\u4f4d\u968f\u673a\u6570\u5b57+\u5927\u5c0f\u5199\u5b57\u6bcd\uff09<\/strong><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #000080\">&lt;%<br \/>\nFunction randKey(obj)<br \/>\nDim char_array(80)<br \/>\nDim temp<br \/>\nFor i = 0 To 9 <br \/>\n&nbsp;&nbsp; char_array(i) = Cstr(i)<br \/>\nNext<br \/>\nFor i = 10 To 35<br \/>\n&nbsp;&nbsp; char_array(i) = Chr(i + 55)<br \/>\nNext<br \/>\nFor i = 36 To 61<br \/>\n&nbsp;&nbsp; char_array(i) = Chr(i + 61)<br \/>\nNext<br \/>\nRandomize<br \/>\nFor i = 1 To obj<br \/>\n&nbsp;&nbsp; &#8216;rnd\u51fd\u6570\u8fd4\u56de\u7684\u968f\u673a\u6570\u57280~1\u4e4b\u95f4\uff0c\u53ef\u7b49\u4e8e0\uff0c\u4f46\u4e0d\u7b49\u4e8e1<br \/>\n&nbsp;&nbsp; &#8216;\u516c\u5f0f\uff1aint((\u4e0a\u9650-\u4e0b\u9650+1)*Rnd+\u4e0b\u9650)\u53ef\u53d6\u5f97\u4ece\u4e0b\u9650\u5230\u4e0a\u9650\u4e4b\u95f4\u7684\u6570\uff0c\u53ef\u7b49\u4e8e\u4e0b\u9650\u4f46\u4e0d\u53ef\u7b49\u4e8e\u4e0a\u9650<br \/>\n&nbsp;&nbsp; temp = temp&amp;char_array(int(62 &#8211; 0 + 1)*Rnd + 0)<br \/>\n&nbsp;&nbsp; <br \/>\nNext<br \/>\nrandKey = temp<br \/>\nEnd Function<br \/>\nResponse.Write(randKey(6))<br \/>\n%&gt;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e24\u79cd\u5199\u6cd5\u90fd\u4e00\u6837\u5176\u5b9e\u5c31\u662f\u8f93\u51fa\u4e0d\u4e00\u6837\uff01 &nbsp; \u7b2c\u4e00\u79cd\uff0813\u4f4d\u968f\u673a\u6570\u6570\u5b57+\u5927\u5c0f\u5199\u5b57\u6bcd\uff09 &nbsp; &lt;% Function gen_key(digits) &#8216;\u5b9a\u4e49\u5e76\u521d\u59cb\u5316\u6570\u7ec4 &nbsp;&nbsp;&nbsp; di&#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-31","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/31","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=31"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":65908,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/31\/revisions\/65908"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=31"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}