{"id":334,"date":"2009-01-08T09:41:03","date_gmt":"2009-01-08T01:41:03","guid":{"rendered":""},"modified":"2014-02-27T23:06:05","modified_gmt":"2014-02-27T15:06:05","slug":"%e7%94%a8asp%e5%88%b6%e4%bd%9c%e5%bc%a0%e6%89%ac%e4%b8%aa%e6%80%a7%e7%9a%84%e8%b0%83%e6%9f%a5%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2009\/01\/08\/334.htm","title":{"rendered":"\u7528ASP\u5236\u4f5c\u5f20\u626c\u4e2a\u6027\u7684\u8c03\u67e5\u7cfb\u7edf"},"content":{"rendered":"<p>\u968f\u7740\u7f51\u7edc\u7684\u666e\u53ca\uff0c\u7f51\u4e0a\u8c03\u67e5\u5f80\u5f80\u80fd\u8fbe\u5230\u8f83\u597d\u7684\u6548\u679c\u3002\u5728\u81ea\u5df1\u7684\u4e2a\u4eba\u7ad9\u70b9\u4e0a\u653e\u4e00\u4e2a\u8da3\u5473\u95ee\u9898\u8c03\u67e5\u677f\uff0c\u7740\u5b9e\u80fd\u4e3a\u7f51\u7ad9\u6dfb\u8272\u4e0d\u5c11\uff1b\u51b5\u4e14\u901a\u8fc7\u8c03\u67e5\u7ed3\u679c\u4f60\u80fd\u66f4\u591a\u66f4\u51c6\u786e\u4e86\u89e3\u7f51\u53cb\u5bf9\u81ea\u5df1\u7ad9\u70b9\u7684\u770b\u6cd5\u3002\u4f5c\u4e3aWebmaster\uff0c\u5982\u679c\u4f60\u7684\u7f51\u7ad9\u4e5f\u9700\u8981\u5c31\u67d0\u4e2a\u4e3b\u9898\u8fdb\u884c\u8c03\u67e5\uff0c\u800c\u4f60\u53c8\u8ba8\u538c\u4f7f\u7528\u522b\u4eba\u514d\u8d39\u63d0\u4f9b\u7684\u8c03\u67e5\u677f\uff08\u514d\u8d39\u5f80\u5f80\u662f\u8981\u4ed8\u51fa\u4ee3\u4ef7\u7684\uff0c\u6bd4\u5982\u6253\u5e7f\u544a\uff01\uff09\uff0c\u90a3\u4e48\u6211\u5efa\u8bae\u4f60\u82b1\u5341\u51e0\u5206\u949f\u65f6\u95f4\u770b\u5b8c\u8fd9\u7bc7\u4ecb\u7ecd\u7528ASP\u5236\u4f5c\u8c03\u67e5\u677f\u7684\u6587\u7ae0\u3002\u4f60\u53ea\u8981\u628a\u6587\u4e2d\u7684\u4ee3\u7801Copy\u5230\u4f60\u7684\u673a\u5b50\u4e0a\uff0c\u7a0d\u505a\u4fee\u6539\uff0c\u4f60\u7acb\u5373\u5c31\u62e5\u6709\u4e00\u4e2a\u5c5e\u4e8e\u4f60\u81ea\u5df1\u7684\u4e2a\u6027\u5316\u8c03\u67e5\u677f\u3002\u597d\u4e86\uff0c\u6253\u8d77\u7cbe\u795e\u5f80\u4e0b\u770b\u5427\u3002 <br \/>\n\u3000\u3000\u672c\u8c03\u67e5\u677f\u5171\u6709\u4e09\u4e2a\u6587\u4ef6\uff1a\u663e\u793a\u8c03\u67e5\u95ee\u9898(research.html)\u3001\u5904\u7406\u7528\u6237\u9009\u62e9(select.asp)\u3001\u6d4f\u89c8\u8c03\u67e5\u7ed3\u679c(viewresult.asp)\u3002\u8bbe\u8ba1\u601d\u8def\u4e3a\uff1aASP\u53d6\u5f97\u7531\u8868\u5355\u53d1\u6765\u7684\u4fe1\u606f\uff0c\u5e76\u636e\u6b64\u4fee\u6539\u8bb0\u5f55\u8c03\u67e5\u5f97\u7968\u6570\u7684\u6570\u636e\u5e93\uff0c\u7136\u540eASP\u8bfb\u53d6\u6570\u636e\u5e93\uff0c\u83b7\u5f97\u5404\u4e2a\u8c03\u67e5\u95ee\u9898\u7684\u5f97\u7968\u6570\u76ee\uff0c\u901a\u8fc7\u5f97\u7968\u6570\u591a\u5c11\u6765\u8c03\u8282\u5bf9\u5e94\u6761\u5f62\u56fe\u663e\u793a\u7684\u5bbd\u6765\u76f4\u89c2\u6bd4\u4f8b\u5730\u7ed9\u51fa\u8c03\u67e5\u7ed3\u679c\u3002\u5728\u7a0b\u5e8f\u7684\u5173\u952e\u5904\uff0c\u6211\u90fd\u7ed9\u51fa\u4e86\u8f83\u4e3a\u8be6\u7ec6\u7684\u6ce8\u91ca\uff0c\u8fd9\u91cc\u5c31\u4e0d\u518d\u8bb2\u8ff0ASP\u7684\u57fa\u672c\u77e5\u8bc6\u3002\u8bfb\u8005\u53ef\u4ee5\u5230\u9676\u5427ASP\u4e13\u680f\u67e5\u9605\u3002\u5f53\u7136\uff0c\u6211\u5e0c\u671b\u4f60\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\u8c03\u8bd5\u7a0b\u5e8f\u65f6\uff0c\u6709\u4e0d\u61c2\u7684\u5730\u65b9\uff0c\u8fd8\u662f\u67e5\u67e5\u8eab\u8fb9\u7684ASP\u6280\u672f\u624b\u518c\uff0c\u770b\u770b\u5bf9\u8c61\u3001\u65b9\u6cd5\u6216\u51fd\u6570\u7684\u8be6\u7ec6\u8bed\u6cd5\u8bd5\u7740\u4fee\u6539\uff0c\u770b\u770b\u7ed3\u679c\u5982\u4f55\u53d8\u5316&mdash;&mdash;\u8fd9\u53ef\u662f\u5b66\u4e60\u7f16\u7a0b\u7684\u4e00\u4e2a\u597d\u65b9\u6cd5\u5462\u3002<\/p>\n<p>\u3000\u3000\u4e00\u3001\u663e\u793a\u8c03\u67e5\u95ee\u9898(research.html)<\/p>\n<p>\u3000\u3000\u8c03\u67e5\u95ee\u9898\u7684\u8bbe\u8ba1\u8981\u4f9d\u636e\u5b9e\u9645\u60c5\u51b5\uff0c\u6216\u8bb2\u7a76\u5b9e\u7528\u6027\u6216\u8bb2\u7a76\u8da3\u5473\u6027\uff0c\u5728\u7f51\u9875\u4e0a\u663e\u793a\u7684\u98ce\u683c\u4e5f\u6216\u6734\u7d20\u6216\u6d3b\u6cfc\uff0c\u672c\u4f8b\u4e2d\u662f\u7b14\u8005\u4e3b\u9875\u4e0a\u7684\u4e00\u4e2a\u5173\u4e8e&ldquo;21\u4e16\u7eaa\u6700\u91cd\u8981\u7684\u662f\u4ec0\u4e48\uff1f&rdquo;\u7684\u8da3\u5473\u8c03\u67e5\uff0c\u4e3a\u8bf4\u660e\u95ee\u9898\uff0c\u4e0b\u9762\u7684\u4ee3\u7801\u4e2d\u7701\u7565\u4e86\u7f8e\u89c2\u4fee\u9970\u7684\u4ee3\u7801\uff0c\u4f60\u81ea\u5df1\u52a8\u624b\u8bbe\u8ba1\u65f6\u5b8c\u5168\u53ef\u4ee5\u4f7f\u7528\u8868\u683c\u7b49\u6280\u5de7\u7f8e\u5316\u8c03\u67e5\u95ee\u9898\u7684\u663e\u793a\u3002\u4e3a\u4e86\u4f7f\u63d0\u6362\u873e\ue1f5\u8d56\u9791\u69ed\u8f88\u6325\u8dcb\u6593\u9f3b\u8019\u8d81\u59ab\ue0ce\u7ee6\u86d1\u61c8\ue246\u96bd\u8bf4\ue1e8\u9c82\u9e93\u7ff1\u8bd8\u59c6\u6868\u6d6e?BR&gt;<br \/>\nresearchindex.html:<\/p>\n<p>&lt; html &gt;<br \/>\n&lt; title &gt;\u8c03\u67e5\u677f\u6d4b\u8bd5&lt; \/title &gt;<br \/>\n&lt; head &gt;<br \/>\n&lt; !&#8211; start\uff1a\u5b9a\u4e49\u65b0\u5f00\u7684\u7a97\u53e3&#8211; &gt;<br \/>\n&lt; script language=javascript &gt;<br \/>\n&lt; !&#8211; <br \/>\nvar newWindow = null<br \/>\nfunction OpenWindow(htmurl)<br \/>\n{ <br \/>\nif (! newWindow || newWindow.closed)<br \/>\n{<br \/>\nnewWindow = <br \/>\nwindow.open(htmurl,&quot;newwin&quot;,&quot;toolbar=no,resiza =no,scrollbars=no,width=400,height=280&quot;);<br \/>\n}else<br \/>\n{<br \/>\nnewWindow.focus();<br \/>\n}<br \/>\n}<br \/>\n\/\/&#8211; &gt;<br \/>\n&lt; \/script &gt;<br \/>\n&lt; !&#8211; end\uff1a\u5b9a\u4e49\u65b0\u5f00\u7684\u7a97\u53e3&#8211; &gt;<br \/>\n&lt; \/head &gt;<br \/>\n&lt; body &gt;<br \/>\n&lt; !&#8211; start\uff1a\u8c03\u67e5\u9898\u76ee\u3001\u9009\u9879\u3000&#8211; &gt;<br \/>\n&lt; p &gt;\u60a8\u8ba4\u4e3a21\u4e16\u7eaa\u6700\u91cd\u8981\u7684\u662f\u4ec0\u4e48\uff1f<\/p>\n<p>&lt; form method=&quot;POST&quot; action=&quot;vote\/select.asp&quot; name=&quot;research&quot; LANGUAGE=&quot;javascript&quot; <br \/>\nonSubmit=&quot;OpenWindow()&quot; target=&quot;newwin&quot; &gt; <br \/>\n&lt; p align=&quot;left&quot; &gt; <br \/>\n&lt; br &gt;<br \/>\n&lt; input type=&quot;radio&quot; value=&quot;1&quot; name=&quot;Options&quot; &gt;\u77e5\u8bc6\uff08\u77e5\u8bc6\u5c31\u662f\u529b\u91cf\uff09&lt; br &gt; <br \/>\n&lt; input type=&quot;radio&quot; value=&quot;2&quot; name=&quot;Options&quot; &gt;\u5b66\u5386\uff08\u5b66\u5386\u793e\u4f1a\u6ca1\u6709\u7ec8\u7ed3\uff09&lt; br &gt; <br \/>\n&lt; input type=&quot;radio&quot; value=&quot;3&quot; name=&quot;Options&quot; &gt;\u91d1\u94b1\uff08\u7ecf\u6d4e\u5c31\u662f\u57fa\u7840\uff09&lt; br &gt; <br \/>\n&lt; input type=&quot;radio&quot; value=&quot;4&quot; name=&quot;Options&quot; &gt;\u7231\u60c5\uff08\u6c38\u4e0d\u8fdb\u5165\u575f\u5893\u7684\u7231\u60c5\uff09&lt; br &gt; <br \/>\n&lt; input type=&quot;radio&quot; value=&quot;5&quot; name=&quot;Options&quot; &gt;\u7406\u60f3\uff08\u5929\u5566\uff0c\u7406\u60f3\u662f\u4ec0\u4e48\uff09&lt; br &gt; <br \/>\n&lt; input type=&quot;radio&quot; value=&quot;6&quot; name=&quot;Options&quot; &gt;\u6c11\u4e3b\u610f\u8bc6\uff08\u5173\u5fc3\u653f\u6cbb\uff09&lt; br &gt; <br \/>\n&lt; input type=&quot;radio&quot; value=&quot;7&quot; name=&quot;Options&quot; &gt;\u79d1\u5b66\u601d\u60f3\uff08\u79d1\u6559\u5174\u56fd\uff09&lt; br &gt;<br \/>\n&lt; input type=&quot;submit&quot; value=&quot;\u63d0\u4ea4&quot; name=&quot;voting&quot; &gt; <br \/>\n&lt; input type=&quot;button&quot; value=&quot;\u67e5\u770b&quot; name=&quot;viewing&quot; onClick=&quot;OpenWindow(vote\/viewresult.asp)&quot; &gt;<br \/>\n&lt; \/form &gt; <br \/>\n&lt; !&#8211; start\uff1a\u8c03\u67e5\u9898\u76ee\u3001\u9009\u9879\u3000&#8211; &gt;<br \/>\n&lt; \/body &gt;<br \/>\n&lt; \/html &gt;&nbsp; <br \/>\n\u3000\u3000\u4e8c\u3001\u5904\u7406\u7528\u6237\u9009\u62e9(select.asp)<\/p>\n<p>\u3000\u3000\u4f9d\u636e\u4e0a\u9762\u7684\u8c03\u67e5\u9009\u9879\uff0c\u6211\u4eec\u5f97\u51fa\u8bb0\u5f55\u8c03\u67e5\u5f97\u7968\u7684\u6570\u636e\u5e93researchdb.mdb\u7684\u8bbe\u8ba1\uff08\u4ee5Access\u4e3a\u4f8b)\uff0c\u8868\u540d\u4e3a\uff1aresearch\u3002\u5982\u679c\u4f60\u7684\u6570\u636e\u5e93\u548c\u8868\u6ca1\u6709\u5b58\u4e3a\u4ee5\u4e0a\u7684\u540d\u5b57\uff0c\u90a3\u4e48\u5728\u540e\u9762\u7684\u7a0b\u5e8f\u548c\u64cd\u4f5c\u4e2d\u4f60\u4e0d\u8981\u5fd8\u8bb0\u4e5f\u76f8\u5e94\u4fee\u6539\u8fc7\u6765\u3002<\/p>\n<p>\u3000\u3000\u5b58\u653e\u8c03\u67e5\u6295\u7968\u6570\u7684\u8868research\uff1a<\/p>\n<p>\u5b57\u6bb5\u540d \u3000\u6570\u636e\u7c7b\u578b\u3000 \u9ed8\u8ba4\u503c <br \/>\nid \u3000\u3000\u3000\u81ea\u52a8\u7f16\u53f7 \u3000 \u30001 <br \/>\nselect1 \u3000\u6570\u5b57 \u3000\u3000\u3000\u30000 <br \/>\nselect2 \u3000\u6570\u5b57 \u3000\u3000\u3000\u30000 <br \/>\nselect3 \u3000\u6570\u5b57 \u3000\u3000\u3000\u30000 <br \/>\nselect4 \u3000\u6570\u5b57 \u3000\u3000\u3000\u30000 <br \/>\nselect5 \u3000\u6570\u5b57 \u3000\u3000\u3000\u30000 <br \/>\nselect6 \u3000\u6570\u5b57 \u3000\u3000\u3000\u30000 <br \/>\nselect7 \u3000\u6570\u5b57\u3000\u3000\u3000\u3000 0<\/p>\n<p>\u3000\u3000\u5efa\u597d\u6570\u636e\u5e93\u540e\uff0c\u6211\u4eec\u6765\u5728\u670d\u52a1\u5668\u4e0a\u5efa\u7acb\u6570\u636e\u6e90\u3002\u9996\u5148\uff0c\u8fd0\u884c&ldquo;\u63a7\u5236\u9762\u677f&rdquo;\u4e2d\u7684&ldquo;ODBC&rdquo;\uff0c\u9009\u62e9&ldquo;\u7cfb\u7edfDSN&rdquo;\uff0c\u6309&ldquo;\u6dfb\u52a0&rdquo;\u6309\u94ae\uff0c\u9009\u53d6&ldquo;Microsoft Access Driver&rdquo;\uff0c\u9009\u5b9a\u540e\u6309&ldquo;\u5b8c\u6210&rdquo;\u6309\u94ae,\u7136\u540e\u5728ODBC\u8bbe\u5b9a\u4e2d&ldquo;\u6570\u636e\u6e90\u540d&rdquo;\u8f93\u5165\u6846\u8f93\u5165\u6570\u636e\u5e93\u540d\u79f0\uff0c\u672c\u4f8b\u4e2d\u4e3aresearchdb\uff0c\u7136\u540e\u6309\u4e0b&ldquo;\u9009\u53d6&rdquo;\u6309\u94ae\u9009\u62e9\u6570\u636e\u5e93\u6587\u4ef6\uff08\u4f60\u4e0d\u4f1a\u8bf4\u4f60\u5fd8\u8bb0\u4e86\u521a\u521a\u8bbe\u8ba1\u7684\u6570\u636e\u5e93\u5b58\u5728\u90a3\u91cc\u4e86\u5427\uff09\uff0c\u9009\u5b9a\u540e\u6309&ldquo;\u786e\u5b9a&rdquo;\uff0c\u4f60\u5373\u53ef\u770b\u5230\u65b0\u5efa\u7684\u6570\u636e\u6e90\u3000researchdb\u3002\u8fd9\u6837\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5728ASP\u4e2d\u8c03\u7528\u4e86\u3002<\/p>\n<p>select.asp:<\/p>\n<p>&lt; %<\/p>\n<p>\u4e0b\u9762\u7684if\u8bed\u53e5\u662f\u901a\u8fc7\u9a8c\u8bc1selected\u662f\u5426\u4e3a\u7a7a\u6765\u5224\u65ad\u7528\u6237\u662f\u5426\u4f5c\u4e86\u9009\u62e9<br \/>\nif request.form(&quot;options&quot;) &lt; &gt;Empty then<br \/>\n% &gt;<\/p>\n<p>&lt; %<br \/>\n\u4e0b\u9762\u7684if\u8bed\u53e5\u662f\u901a\u8fc7\u6bd4\u8f83Request\u7684\u4e24\u4e2acollection(ServerVariables\u548cCookies)\u7684\u503c<br \/>\n\u6765\u9632\u6b62\u7528\u6237\u8fde\u7eed\u6309\u63d0\u4ea4\u800c\u5f71\u54cd\u8c03\u67e5\u7684\u7ed3\u679c<br \/>\nif not Request.ServerVariables(&quot;REMOTE_ADDR&quot;)=request.cookies(&quot;IPAddress&quot;) then<br \/>\n\u628a\u8bbf\u95ee\u5ba2\u6237\u7684IP\u4fe1\u606f\u5199\u5165Cookies<br \/>\nresponse.cookies(&quot;IPAddress&quot;)=Request.ServerVariables(&quot;REMOTE_ADDR&quot;)<br \/>\n% &gt;<br \/>\n&lt; %<br \/>\n\u5efa\u7acb\u8fde\u63a5\uff08Connection\uff09\u5bf9\u8c61\uff0c\u6253\u5f00\u8bb0\u5f55\u8c03\u67e5\u7ed3\u679c\u7684\u6570\u636e\u5e93<br \/>\nset conn=server.createobject(&quot;ADODB.CONNECTION&quot;)<br \/>\nconn.open &quot;researchdb&quot;<br \/>\n% &gt;<\/p>\n<p>&lt; %<br \/>\n\u5b9a\u4e49\u53d8\u91cf<br \/>\ndim rs<br \/>\ndim sql<br \/>\ndim selected<br \/>\nselected=request.form(&quot;options&quot;)<br \/>\n\u5efa\u7acb\u8bb0\u5f55\u96c6\u5408\uff08Recordset\uff09\u5bf9\u8c61\uff0c\u7528\u65b9\u6cd5Open\u6253\u5f00\u5bf9\u8c61\uff0c\u540c\u65f6\u4fee\u6539\u5bf9\u5e94\u7684\u6570\u636e<br \/>\nset rs=server.createobject(&quot;adodb.recordset&quot;)<br \/>\n\u4fee\u6539\u6570\u636e\u8868ressearch\u4e2d\u7684\u6570\u636e\uff0c\u5373\u5bf9\u5e94\u7684\u6295\u7968\u6570\u589e\u52a01<br \/>\nsql=&quot;update research set select&quot;&amp;selected&amp;&quot;=select&quot;&amp;selected&amp;&quot;+1 where id=1&quot;<br \/>\nrs.open sql,conn,3,3<br \/>\n\u4ece\u5185\u5b58\u4e2d\u6e05\u9664\u8bb0\u5f55\u96c6\u5408\u5bf9\u8c61<br \/>\nset rs=nothing<br \/>\n\u5173\u95ed\u8fde\u63a5 <br \/>\nconn.close<br \/>\n\u4ece\u5185\u5b58\u4e2d\u6e05\u9664\u8fde\u63a5\u5bf9\u8c61<br \/>\nset conn=nothing<br \/>\n\u8fde\u63a5\u5230\u6d4f\u89c8\u8c03\u67e5\u7ed3\u679c\u7684\u9875\u9762<br \/>\nresponse.redirect &quot;viewresult.asp&quot;<br \/>\nelse<br \/>\nResponse.write &quot;\u6295\u7968\u5931\u8d25\u63d0\u793a\uff1a\u60a8\u521a\u624d\u5df2\u6295\u4e86\u7968\uff0c\u8c22\u8c22\u60a8\u7684\u652f\u6301\uff01&quot;<br \/>\nend if <br \/>\nelse<br \/>\nResponse.write &quot;\u6295\u7968\u5931\u8d25\u63d0\u793a\uff1a\u60a8\u5fd8\u8bb0\u9009\u62e9\u4e86\uff01&quot;<br \/>\nend if<br \/>\n% &gt;&nbsp;<\/p>\n<p>\u3000\u3000\u4e09\u3001\u6d4f\u89c8\u8c03\u67e5\u7ed3\u679c(viewresult.asp)<\/p>\n<p>\u3000\u3000\u672c\u4f8b\u4e2d\u4f7f\u7528\u6761\u5f62\u56fe\u6765\u76f4\u89c2\u663e\u793a\u8c03\u67e5\u7ed3\u679c\uff0c\u65b9\u6cd5\u662f\u7528\u9009\u9879\u7684\u6295\u7968\u6570\u5360\u603b\u6295\u7968\u6570\u7684\u767e\u5206\u6bd4\u503c\u4e58\u4e0a5\uff0c\u5f97\u51fa\u7684\u503c\u4f5c\u4e3a\u6761\u5f62\u56febar.gif\u663e\u793a\u7684\u5bbd\uff08\u53ef\u7528\u5e38\u89c1\u7684\u56fe\u8c61\u5de5\u5177\u5236\u4f5c\u4e00\u4e2a\u6e10\u53d8\u8272\u7684\u5c0f\u6761\u5f62\u56fe\uff0c\u6216\u662f\u5230\u7f51\u4e0adown\u4e00\u4e2a)\u3002\u4e3a\u4e86\u7ed9\u51fa\u5e26\u4e24\u4e3a\u5c0f\u6570\u7684\u5f97\u7968\u7684\u767e\u5206\u6bd4\uff0c\u7a0b\u5e8f\u4e2d\u4f7f\u7528\u4e86VBScript\u4e2d\u7684\u56db\u820d\u4e94\u5165\u51fd\u6570Round\u3002\u4e3a\u4e86\u7f8e\u89c2\uff0c\u628a\u8c03\u67e5\u7ed3\u679c\u653e\u5230\u8868\u683c\u4e2d\u663e\u793a\uff0c\u5982\u56fe\u6240\u793a\u3002\u4e0b\u9762\u7ed9\u51fa\u7684\u4ee3\u7801\u4e2d\u7565\u53bb\u4e86\u8868\u683c\u7684\u8bbe\u8ba1\u3002<\/p>\n<p>viewresult.asp <br \/>\n&lt; %<br \/>\nset conn=server.createobject(&quot;ADODB.CONNECTION&quot;)<br \/>\nconn.open &quot;researchdb&quot;<br \/>\n% &gt; <br \/>\n&lt; %<br \/>\ndim rs<br \/>\ndim sql<br \/>\ndim select1<br \/>\ndim select2<br \/>\ndim select3<br \/>\ndim select4<br \/>\ndim select5<br \/>\ndim select6<br \/>\ndim select7<br \/>\ndim total<br \/>\nset rs=server.createobject(&quot;adodb.recordset&quot;)<br \/>\nsql=&quot;select * from research where id=1&quot;<br \/>\nrs.open sql,conn,1,1<br \/>\ntotal=rs(&quot;select1&quot;)+rs(&quot;select2&quot;)+rs(&quot;select3&quot;)+<br \/>\n_ rs(&quot;select4&quot;)+rs(&quot;select5&quot;)+rs(&quot;select6&quot;)+rs(&quot;select7&quot;)<br \/>\n\u5224\u65ad\u603b\u7968\u6570\u662f\u5426\u4e3a0\uff0c\u786e\u4fdd\u4e0b\u9762\u7684\u9664\u6cd5\u6709\u6548<br \/>\nif total &gt; 0 then<br \/>\nselect1=(rs(&quot;select1&quot;)\/total)*100<br \/>\nselect2=(rs(&quot;select2&quot;)\/total)*100<br \/>\nselect3=(rs(&quot;select3&quot;)\/total)*100<br \/>\nselect4=(rs(&quot;select4&quot;)\/total)*100<br \/>\nselect5=(rs(&quot;select5&quot;)\/total)*100<br \/>\nselect6=(rs(&quot;select6&quot;)\/total)*100<br \/>\nselect7=(rs(&quot;select7&quot;)\/total)*100<br \/>\n% &gt;<br \/>\n&lt; p &gt;\u8c22\u8c22\u60a8\u7684\u53c2\u4e0e\uff0c\u4e0b\u9762\u662f\u5f53\u524d\u7684\u8c03\u67e5\u7ed3\u679c<br \/>\n&lt; p &gt;<br \/>\n\u25c7\u77e5\u8bc6:<br \/>\n&lt; img src=bar.gif width=&lt; %=int(select1*5)% &gt; height=4 &gt;<br \/>\n&lt; %=rs(&quot;select1&quot;)% &gt;\u4eba \u5360\uff1a&lt; %=round(select1,2)% &gt;%&lt; br &gt; <br \/>\n\u25c7\u5b66\u5386:<br \/>\n&lt; img src=bar.gif width=&lt; %=int(select2*5)% &gt; height=4 &gt;<br \/>\n&lt; %=rs(&quot;select2&quot;)% &gt;\u4eba \u5360\uff1a&lt; %=round(select2,2)% &gt;%&lt; br &gt; <br \/>\n\u25c7\u91d1\u94b1:<br \/>\n&lt; img src=bar.gif width=&lt; %=int(select3)*5% &gt; height=4 &gt;<br \/>\n&lt; %=rs(&quot;select3&quot;)% &gt;\u4eba \u5360\uff1a&lt; %=round(select3,2)% &gt;%&lt; br &gt; <br \/>\n\u25c7\u7231\u60c5:<br \/>\n&lt; img src=bar.gif width=&lt; %=int(select4)*5% &gt; height=4 &gt;<br \/>\n&lt; %=rs(&quot;select4&quot;)% &gt;\u4eba \u5360\uff1a&lt; %=round(select4,2)% &gt;%&lt; br &gt; <br \/>\n\u25c7\u7406\u60f3:<br \/>\n&lt; img src=bar.gif width=&lt; %=int(select5)*5% &gt; height=4 &gt;<br \/>\n&lt; %=rs(&quot;select5&quot;)% &gt;\u4eba \u5360\uff1a&lt; %=round(select5,2)% &gt;%&lt; br &gt; <br \/>\n\u25c7\u6c11\u4e3b\u610f\u8bc6:<br \/>\n&lt; img src=bar.gif width=&lt; %=int(select6)%*5 &gt; height=4 &gt;<br \/>\n&lt; %=rs(&quot;select6&quot;)% &gt;\u4eba \u5360\uff1a&lt; %=round(select6,2)% &gt;%&lt; br &gt; <br \/>\n\u25c7\u79d1\u5b66\u601d\u60f3:<br \/>\n&lt; img src=bar.gif width=&lt; %=int(select7)%*5 &gt; height=4 &gt;<br \/>\n&lt; %=rs(&quot;select7&quot;)% &gt;\u4eba \u5360\uff1a&lt; %=round(select7,2)% &gt;%&lt; \/p &gt;<\/p>\n<p>&lt; p align=&quot;center&quot; &gt;\u5df2\u7ecf\u6709\uff1a&lt; %=total% &gt;\u4eba\u53c2\u52a0\u8c03\u67e5&lt; br &gt;&lt; br &gt; <br \/>\n\u3010&lt; a href=&quot;javascript:window.close()&quot; &gt;\u5173\u95ed\u7a97\u53e3&lt; \/a &gt;\u3011&lt; \/p &gt; <br \/>\n&lt; p &gt; <br \/>\n&lt; % <br \/>\nelse <br \/>\nresponse.write &quot;\u8fd8\u6ca1\u6709\u4eba\u53c2\u4e0e\u8c03\u67e5&quot;<br \/>\nend if <br \/>\nrs.close <br \/>\nset rs=nothing<br \/>\nconn.close <br \/>\nset conn=nothing<br \/>\n% &gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u968f\u7740\u7f51\u7edc\u7684\u666e\u53ca\uff0c\u7f51\u4e0a\u8c03\u67e5\u5f80\u5f80\u80fd\u8fbe\u5230\u8f83\u597d\u7684\u6548\u679c\u3002\u5728\u81ea\u5df1\u7684\u4e2a\u4eba\u7ad9\u70b9\u4e0a\u653e\u4e00\u4e2a\u8da3\u5473\u95ee\u9898\u8c03\u67e5\u677f\uff0c\u7740\u5b9e\u80fd\u4e3a\u7f51\u7ad9\u6dfb\u8272\u4e0d\u5c11\uff1b\u51b5\u4e14\u901a\u8fc7\u8c03\u67e5\u7ed3\u679c\u4f60\u80fd\u66f4\u591a\u66f4\u51c6\u786e\u4e86\u89e3\u7f51\u53cb\u5bf9\u81ea\u5df1\u7ad9\u70b9\u7684\u770b\u6cd5\u3002\u4f5c\u4e3aWebmaster\uff0c\u5982\u679c\u4f60\u7684\u7f51\u7ad9\u4e5f\u9700\u8981\u5c31\u67d0\u4e2a\u4e3b\u9898\u8fdb\u884c\u8c03\u67e5\uff0c\u800c\u4f60\u53c8\u8ba8\u538c\u4f7f\u7528&#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-334","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/334","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=334"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/334\/revisions"}],"predecessor-version":[{"id":66210,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/334\/revisions\/66210"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=334"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=334"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}