{"id":382,"date":"2005-10-31T06:11:59","date_gmt":"2005-10-30T18:11:59","guid":{"rendered":""},"modified":"2005-10-31T06:11:59","modified_gmt":"2005-10-30T18:11:59","slug":"","status":"publish","type":"post","link":"https:\/\/www.mudone.com\/?p=382","title":{"rendered":"\u7528ASP\u505a\u5168\u6587\u68c0\u7d22"},"content":{"rendered":"<p>\u6458\u8981\uff1a\u901a\u8fc7\u8bcd\u53e5\u67e5\u627e\u76f8\u5173\u7684\u5168\u6587\u662f\u6d4f\u89c8\u5668\u7aef\u5e38\u7528\u7684\u65b9\u6cd5\uff0cASP\u7c7b\u4f3c\u4e8eCGI\uff0c\u4e5f\u53ef\u4ee5\u8fdb\u884c\u7b80\u5355\u7684\u6587\u672c\u65b9\u5f0f\u5168\u6587\u68c0\u7d22<\/p>\n<p>\u3000\u3000\u5728 Internet\/Intranet\u4e0a\u5bf9\u67d0\u7c7b\u4fe1\u606f\u505a\u8be6\u7ec6\u6d4f\u89c8\u548c\u5168\u6587\u68c0\u7d22\u4e5f\u662f\u5e38\u78b0\u5230\u7684\u60c5\u51b5\u3002ASP\u662f\u5fae\u8f6f\u516c\u53f8\u5f00\u53d1\u7684\u7528\u4e8e\u5236\u4f5c\u52a8\u6001Web\u9875\u7684\u4e00\u79cd\u670d\u52a1\u5668\u7aef\u811a\u672c\u578b\u5f0f\uff08\u6216\u66f0\u7f16\u5199\u73af\u5883\uff09\u3002\u5b83\u4f7f\u7528VBScript\u6216JavaScript\u7b49\u7b80\u6613\u7684\u811a\u672c\u8bed\u8a00\uff0c\u96c6\u6210\u5728HTML\u7801\u4e2d\uff0c\u5728\u670d\u52a1\u5668\u7aef\u54cd\u5e94\u6d4f\u89c8\u5668\u7aef\u8bf7\u6c42\u800c\u6267\u884c\u6570\u636e\u8bbf\u95ee\u548c\u8fc7\u7a0b\uff08\u6216\u5bf9\u8c61\uff09\u8c03\u7528\u5e76\u4ea7\u751f\u6d4f\u89c8\u5668\u7aef\u6267\u884c\u7684\u811a\u672c\u8bed\u8a00\u3002\u672c\u6587\u4ecb\u7ecd\u7528ASP\u7f16\u5199\u5168\u6587\u68c0\u7d22\u4ee3\u7801\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u65b9\u6cd5\u4ecb\u7ecd\uff1a<br \/>\n\u3000\u3000\u786e\u5b9a\u88ab\u68c0\u7d22\u7684\u6587\u4ef6\u3002\u5c06\u5b83\u4eec\u4fdd\u5b58\u5728\u540c\u4e00\u6587\u4ef6\u5939\u4e2d\u3002\u6587\u4ef6\u7684\u7c7b\u578b\u53ef\u4ee5\u662f\u4efb\u4f55\u6587\u672c\u7c7b\u578b\uff08\u5305\u62ec.htm\u7f51\u9875\u6587\u4ef6\u7c7b\u578b\uff09<br \/>\n\u3000\u3000\u5efa\u7acb\u88ab\u68c0\u7d22\u6587\u4ef6\u7684\u4fe1\u606f\u5e93\u3002\u5176\u4e2d\u4e3b\u8981\u5305\u542b\u6587\u4ef6\u540d\uff0c\u6587\u4ef6\u6807\u9898\u7b49\u3002<br \/>\n\u3000\u3000\u7528ADO\u65b9\u5f0f\u8bbf\u95ee\u6570\u636e\u5e93\u3002\u5efa\u7acb\u8bb0\u5f55\u96c6\u5bf9\u8c61\u3002<br \/>\n\u3000\u3000\u9010\u4e2a\u6253\u5f00\u8bb0\u5f55\u96c6\u4e2d\u5f53\u524d\u8bb0\u5f55\u6240\u6307\u5411\u7684\u6587\u4ef6\u3002\u7528\u67e5\u627e\u7684\u5b57\u4e32\u5bf9\u6587\u4ef6\u7684\u5168\u6587\u672c\u8fdb\u884c\u5339\u914d\u6bd4\u8f83\u3002<br \/>\n<!--more-->\u3000\u3000\u5c06\u7b26\u5408\u6761\u4ef6\u7684\u6587\u4ef6\u6807\u9898\u8f93\u51fa\u5230\u5ba2\u6237\u7aefWeb\u9875\uff0c\u5e76\u52a0\u5165\u6307\u5411\u8be5\u6587\u4ef6\u7684\u8d85\u94fe\uff0c\u4ee5\u4f9b\u7528\u6237\u9009\u62e9\u6d4f\u89c8\u3002<br \/>\n\u3000\u3000\u6280\u672f\u8981\u70b9\uff1a<br \/>\n\u3000\u3000\u6570\u636e\u6e90\u3002\u8981\u5728\u521b\u5efa\u811a\u672c\u4e4b\u524d,\u5229\u7528Windows95\u63a7\u5236\u9762\u677f\u4e2d\u7684ODBC\u6307\u5b9a\u8981\u8bbf\u95ee\u7684\u6570\u636e\u5e93\u53ca\u5176\u9a71\u52a8\u7a0b\u5e8f\uff0c\u4ee5\u6570\u636e\u6e90\u540d\uff08DSN\uff09\u6807\u8bc6\u4e4b\u3002<br \/>\n\u3000\u3000\u5339\u914d\u5b57\u4e32\u7684\u957f\u5ea6\u3002\u7531\u4e8e\u6d4f\u89c8\u5668\u7aef\u7684\u6570\u636e\u7ecf\u8fc7\u7f16\u7801\u4f20\u5230\u670d\u52a1\u5668\u7aef\uff0cASP\u901a\u8fc7\u5176\u5185\u5efa\u5bf9\u8c61Request\u53d6\u5f97\u7684\u6570\u636e\u4e5f\u5e76\u975e\u5b8c\u5168\u662f\u7528\u6237\u8f93\u5165\u7684\u6709\u7528\u4fe1\u606f<br \/>\n\uff0c\u6240\u4ee5\u8981\u52a0\u4ee5\u5904\u7406\u3002\u53ef\u4ee5\u5728\u8f93\u5165\u5b57\u4e32\u540e\u9644\u52a0\u4e00\u6807\u5fd7\u5b57\u7b26\uff08\u5982#\u6216chr(7)\uff09\u3002\u672c\u6587\u5219\u91c7\u53d6\u53e6\u4e00\u79cd\u65b9\u6cd5\uff0c\u5373\u8ba1\u7b97\u6709\u6548\u4fe1\u606f\u7684\u957f\u5ea6\u3002\u4ece\u800c\u622a\u53d6\u6240\u9700\u7684<br \/>\n\u5b57\u4e32\u3002<br \/>\n\u3000\u3000\u521b\u5efa\u811a\u672c\u7684\u6587\u4ef6\u7cfb\u7edf\u5bf9\u8c61Scripting.FileSystemObject\uff0c\u4ece\u800c\u6253\u5f00\u6587\u672c\u6d41\u4ee5\u8bfb\u5165\u3002<br \/>\n\u3000\u3000\u7279\u70b9\uff1a<br \/>\n\u3000\u3000\u76f4\u63a5\u5bf9.htm\u6587\u4ef6\u8fdb\u884c\u5168\u6587\u68c0\u7d22\uff0c\u7701\u5374\u8bb8\u591a\u8f6c\u6362\u8fc7\u7a0b\u3002.htm\u6587\u4ef6\u53c8\u7528\u4e8e\u7f51\u9875\u7684\u663e\u793a\uff0c\u4e00\u4e3e\u4e24\u5f97\u3002<br \/>\n\u3000\u3000\u5e94\u7528ASP\uff0c\u7b80\u5355\u660e\u4e86\uff0c\u6613\u4e8e\u5b9e\u73b0\u3002<br \/>\n\u3000\u3000\u672c\u4f8bASP\u4ee3\u7801\uff1a<\/p>\n<div class=\"quote\">\n<div class=\"quote-title\">\u5f15\u7528\u81ea <u><\/u><\/div>\n<div class=\"quote-content\">\u3008%@LANGUAGE=&quot;VBSCRIPT&quot;%\u3009<br \/>\n\u3000\u3000\u3008html\u3009<br \/>\n\u3000\u3000\u3008head\u3009<br \/>\n\u3000\u3000\u3008metaNAME=&quot;GENERATOR&quot;Content=&quot;MicrosoftFrontPage3.0&quot;\u3009<br \/>\n\u3000\u3000\u3008metaHTTP-EQUIV=&quot;Content-Type&quot;content=&quot;text\/html;charset=gb_2312-80&quot;\u3009<br \/>\n\u3000\u3000\u3008title\u3009DocumentTitle\u3008\/title\u3009<br \/>\n\u3000\u3000\u3008metaname=&quot;MicrosoftBorder&quot;content=&quot;tl,default&quot;\u3009\u3008\/head\u3009<br \/>\n\u3000\u3000\u3008bodyBACKGROUND=&quot;\/ie\/images\/watermrk.gif&quot;BGPROPERTIES=&quot;FIXED&quot;BGCOLOR=&quot;#00FFFF&quot;\u3009<br \/>\n\u3000\u3000\u3008%<br \/>\n\u3000\u3000mousepointer=13<br \/>\n\u3000\u3000SetConn1=Server.CreateObject(&quot;ADODB.Connection&quot;)<br \/>\n\u3000\u3000conn1.open&quot;DSN=cznj&quot;<br \/>\n\u3000\u3000Setrcst1=conn1.execute(&quot;SELECT*FROMpages_catalogue&quot;)<br \/>\n\u3000\u3000sch_str=request.form(&quot;text1&quot;)<br \/>\n\u3000\u3000doubbytes=len(sch_str)\\2<br \/>\n\u3000\u3000sch_str=left(sch_str,doubbytes)<br \/>\n\u3000\u3000Response.Write&quot;\u3008strong\u3009\u3008CENTER\u3009\u3008H2\u3009\u67e5\u627e\u7ed3\u679c\u3008\/H2\u3009\u3008HR\u3009\u3008Br\u3009\u3008\/strong\u3009&quot;<br \/>\n\u3000\u3000Dimresult<br \/>\n\u3000\u3000result=false<br \/>\n\u3000\u3000Response.Write&quot;\u3008UL\u3009&quot;<br \/>\n\u3000\u3000dowhilenotrcst1.eof<br \/>\n\u3000\u3000tit=rcst1.fields(&quot;file_title&quot;)<br \/>\n\u3000\u3000fn=rcst1.fields(&quot;file_name&quot;)<br \/>\n\u3000\u3000file_name=Server.MapPath(&quot;\/&quot;)&amp;&quot;\\njweb\\private\\&quot;&amp;fn<br \/>\n\u3000\u3000to_find=text_match(file_name,sch_str)<br \/>\n\u3000\u3000ifto_findthen<br \/>\n\u3000\u3000url=&quot;private\/&quot;&amp;fn<br \/>\n\u3000\u3000Response.Write&quot;\u3008LEFT\u3009\u3008LI\u3009\u3008H4\u3009\u3008AHREF=&quot;&amp;url&amp;&quot;\u3009&quot;&amp;tit<br \/>\n\u3000\u3000endif<br \/>\n\u3000\u3000rcst1.movenext<br \/>\n\u3000\u3000result=resultorto_find<br \/>\n\u3000\u3000loop<br \/>\n\u3000\u3000Response.Write&quot;\u3008\/UL\u3009&quot;<br \/>\n\u3000\u3000ifnotresultthen<br \/>\n\u3000\u3000Response.Write&quot;\u3008H3\u3009\u3008I\u3009\u672a\u627e\u5230\uff01\u3008\/I\u3009\u3008\/H3\u3009&quot;<br \/>\n\u3000\u3000endif<br \/>\n\u3000\u3000mousepointer=0<br \/>\n\u3000\u3000%\u3009<br \/>\n\u3000\u3000\u3008scriptRUNAT=&quot;Server&quot;LANGUAGE=&quot;VBScript&quot;\u3009<br \/>\n\u3000\u3000functiontext_match(filename,search_string)<br \/>\n\u3000\u3000dimretstring<br \/>\n\u3000\u3000dimfind_pos<br \/>\n\u3000\u3000Dimfso,a<br \/>\n\u3000\u3000dimdone<br \/>\n\u3000\u3000text_match=false<br \/>\n\u3000\u3000Setfso=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)<br \/>\n\u3000\u3000Seta=fso.OpenTextFile(filename,1,FALSE)&quot;ForReading&#8211;\u30091<br \/>\n\u3000\u3000done=a.AtEndOfStreamortext_match<br \/>\n\u3000\u3000DoWhilenotdone<br \/>\n\u3000\u3000retstring=a.ReadLine<br \/>\n\u3000\u3000find_pos=instr(retstring,search_string)<br \/>\n\u3000\u3000iffind_pos\u30090thentext_match=true<br \/>\n\u3000\u3000done=a.AtEndOfStreamortext_match\u3000Loop<br \/>\n\u3000\u3000a.Close<br \/>\n\u3000\u3000endfunction<br \/>\n\u3000\u3000\u3008\/script\u3009<br \/>\n\u3000\u3000\u3008\/body\u3009<br \/>\n\u3000\u3000\u3008\/html\u3009<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6458\u8981\uff1a\u901a\u8fc7\u8bcd\u53e5\u67e5\u627e\u76f8\u5173\u7684\u5168\u6587\u662f\u6d4f\u89c8\u5668\u7aef\u5e38\u7528\u7684\u65b9\u6cd5\uff0cASP\u7c7b\u4f3c\u4e8eCGI\uff0c\u4e5f\u53ef\u4ee5\u8fdb\u884c\u7b80\u5355\u7684\u6587\u672c\u65b9\u5f0f\u5168\u6587\u68c0\u7d22 \u3000\u3000\u5728 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-382","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=382"}],"version-history":[{"count":0,"href":"https:\/\/www.mudone.com\/index.php?rest_route=\/wp\/v2\/posts\/382\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mudone.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}