{"id":67740,"date":"2017-02-21T02:03:54","date_gmt":"2017-02-20T18:03:54","guid":{"rendered":"http:\/\/www.xiaoyebailong.com\/?p=67740"},"modified":"2017-02-26T02:08:32","modified_gmt":"2017-02-25T18:08:32","slug":"asp%e6%a8%a1%e6%8b%9fpost%e5%bc%82%e6%ad%a5%e6%8f%90%e4%ba%a4%e6%95%b0%e6%8d%ae%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2017\/02\/21\/67740.htm","title":{"rendered":"ASP\u6a21\u62dfPOST\u5f02\u6b65\u63d0\u4ea4\u6570\u636e\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u6709\u65f6\u9700\u8981\u83b7\u53d6\u8fdc\u7a0b\u7f51\u7ad9\u7684\u67d0\u4e9b\u4fe1\u606f\uff0c\u800c\u670d\u52a1\u5668\u53c8\u9650\u5236\u4e86GET\u65b9\u5f0f\uff0c\u53ea\u80fd\u901a\u8fc7POST\u6570\u636e\u63d0\u4ea4\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7asp\u6765\u5b9e\u73b0\u6a21\u62df\u63d0\u4ea4post\u6570\u636e\uff0c\u7f51\u4e0a\u6709\u633a\u591a\u8fd9\u6837\u7684\u4f8b\u5b50\u7684\u3002\u4e0b\u9762\u7684\u662f\u6211\u81ea\u5df1\u5199\u7684\u6bd4\u8f83\u7b80\u6d01\u6613\u61c2\u7684\u51fd\u6570\u3002<\/p>\n<p>\u9996\u5148\uff0c\u9700\u8981\u4e00\u4e2a\u7f16\u7801\u8bbe\u7f6e\u7684\u51fd\u6570\uff0c\u56e0\u4e3aasp\u4e00\u822c\u4e3agbk\u7684\uff0c\u800c\u6807\u51c6\u7684\u7f51\u7ad9\u73b0\u5728\u5927\u90fd\u4f7f\u7528utf-8\u7684\u3002\u6240\u4ee5\u9700\u8981\u8f6c\u6362\u3002<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n12\r\n13\r\n14\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"asp\">function BytesToBstr(body,Cset) \r\ndim objstream \r\nset objstream = Server.CreateObject(\"adodb.stream\")\r\nobjstream.Type = 1 \r\nobjstream.Mode =3 \r\nobjstream.Open \r\nobjstream.Write body \r\nobjstream.Position = 0 \r\nobjstream.Type = 2 \r\nobjstream.Charset = Cset \r\nBytesToBstr = objstream.ReadText \r\nobjstream.Close \r\nset objstream = nothing \r\nEnd function<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u5176\u6b21\u5c31\u662f\u7528\u7ec4\u4ef6\u5b9e\u73b0post\u6570\u636e\u7684\u63d0\u4ea4\u4e86\uff0c\u6211\u8fd9\u91cc\u4f7f\u7528\u4e86<strong>MSXML2.SERVERXMLHTTP.3.0<\/strong>\u3002\u5f53\u7136\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5176\u4ed6\u7684\u3002<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8\r\n9\r\n10\r\n11\r\n12\r\n13\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"asp\">function PostHTTPPage(url,data) \r\ndim Http \r\nset Http=server.createobject(\"MSXML2.SERVERXMLHTTP.3.0\")\r\nHttp.open \"POST\",url,false \r\nHttp.setRequestHeader \"CONTENT-TYPE\", \"application\/x-www-form-urlencoded\" \r\nHttp.send(data) \r\nif Http.readystate&lt;&gt;4 then \r\nexit function \r\nEnd if\r\nPostHTTPPage=bytesToBSTR(Http.responseBody,\"utf-8\") \r\nset http=nothing \r\nif err.number&lt;&gt;0 then err.Clear \r\nEnd function<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u4f7f\u7528\u7684\u65f6\u5019\u5c31\u662f\u8fd9\u6837\u5b50\uff1a<\/p>\n<div class=\"wp_syntax\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"asp\">PostHTTPPage(\"www.aimks.com\",\"str1=a&amp;str2=b&amp;str3=c\")<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u65f6\u9700\u8981\u83b7\u53d6\u8fdc\u7a0b\u7f51\u7ad9\u7684\u67d0\u4e9b\u4fe1\u606f\uff0c\u800c\u670d\u52a1\u5668\u53c8\u9650\u5236\u4e86GET\u65b9\u5f0f\uff0c\u53ea\u80fd\u901a\u8fc7POST\u6570\u636e\u63d0\u4ea4\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7asp\u6765\u5b9e\u73b0\u6a21\u62df\u63d0\u4ea4post\u6570\u636e\uff0c\u7f51\u4e0a\u6709\u633a\u591a\u8fd9\u6837\u7684\u4f8b\u5b50\u7684\u3002\u4e0b\u9762\u7684\u662f\u6211\u81ea\u5df1\u5199\u7684\u6bd4\u8f83\u7b80\u6d01\u6613\u61c2\u7684\u51fd\u6570\u3002 \u9996\u5148\uff0c\u9700\u8981\u4e00\u4e2a\u7f16\u7801\u8bbe\u7f6e\u7684\u51fd\u6570\uff0c\u56e0\u4e3aa&#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-67740","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67740","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=67740"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67740\/revisions"}],"predecessor-version":[{"id":67741,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/67740\/revisions\/67741"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=67740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=67740"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=67740"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=67740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}