{"id":201,"date":"2008-12-04T08:52:33","date_gmt":"2008-12-04T00:52:33","guid":{"rendered":""},"modified":"2014-02-27T22:59:40","modified_gmt":"2014-02-27T14:59:40","slug":"%e7%94%a8asp%e9%9a%90%e8%97%8f%e6%96%87%e4%bb%b6%e8%b7%af%e5%be%84%ef%bc%8c%e5%ae%9e%e7%8e%b0%e9%98%b2%e7%9b%97%e9%93%be","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2008\/12\/04\/201.htm","title":{"rendered":"\u7528Asp\u9690\u85cf\u6587\u4ef6\u8def\u5f84\uff0c\u5b9e\u73b0\u9632\u76d7\u94fe"},"content":{"rendered":"<p>\u3000\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e00\u4e2a\u9759\u6001\u6587\u4ef6\u7684\u5b9e\u9645\u8def\u5f84\u5982\uff1a<a rel=\"nofollow\" href=\"http:\/\/www.xx.com\/download\/3zhacom.pdf\" target=\"_blank\">http:\/\/www.xx.com\/download\/3zhacom.pdf<\/a>\uff0c\u5982\u679c\u670d\u52a1\u5668\u6ca1\u6709\u4f5c\u7279\u522b\u7684\u9650\u5236\u8bbe\u7f6e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u6beb\u4e0d\u8d39\u529b\u7684\u628a\u5b83\u4e0b\u8f7d\u4e0b\u6765\uff01\u5f53\u7f51\u7ad9\u63d0\u4f9b3zhacom.pdf\u4e0b\u8f7d\u65f6\uff0c\u600e\u4e48\u6837\u624d\u80fd\u8ba9\u4e0b\u8f7d\u8005\u65e0\u6cd5\u5f97\u5230\u4ed6\u7684\u5b9e\u9645\u8def\u5f84\u5462\uff01\u672c\u6587\u5c31\u6765\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528Asp\u6765\u9690\u85cf\u6587\u4ef6\u7684\u5b9e\u9645\u4e0b\u8f7d\u8def\u5f84\u3002&nbsp; <\/p>\n<p>\u3000\u3000\u6211\u4eec\u5728\u7ba1\u7406\u7f51\u7ad9\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u628a\u6269\u5c55\u540d\u4e00\u6837\u7684\u6587\u4ef6\u653e\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u4e0b\uff0c\u8d77\u4e00\u4e2a\u6bd4\u8f83\u7279\u522b\u540d\u5b57\uff0c\u4f8b\u5982\u653epdf\u6587\u4ef6\u76ee\u5f55\u4e3athe_pdf_file_s\uff0c\u628a\u4e0b\u9762\u4ee3\u7801\u53e6\u5b58\u4e3adown.asp\uff0c\u4ed6\u7684\u7f51\u4e0a\u8def\u5f84\u4e3a<a rel=\"nofollow\" href=\"http:\/\/www.xx.com\/down.asp\" target=\"_blank\">http:\/\/www.xx.com\/down.asp<\/a>\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u7528<a rel=\"nofollow\" href=\"http:\/\/www.xx.com\/down.asp?FileName=3zhacom\" target=\"_blank\">http:\/\/www.xx.com\/down.asp?FileName=3zhacom<\/a>.pdf\u6765\u4e0b\u8f7d\u8fd9\u4e2a\u6587\u4ef6\u4e86\uff0c\u800c\u4e14\u4e0b\u8f7d\u8005\u65e0\u6cd5\u770b\u5230\u8fd9\u4e2a\u6587\u4ef6\u5b9e\u9645\u4e0b\u8f7d\u8def\u5f84\u7684\uff01\u5728down.asp\u4e2d\u6211\u4eec\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u4e0b\u8f7d\u6587\u4ef6\u662f\u5426\u9700\u8981\u767b\u9646\uff0c\u5224\u65ad\u4e0b\u8f7d\u7684\u6765\u6e90\u9875\u662f\u5426\u4e3a\u5916\u90e8\u7f51\u7ad9\uff0c\u4ece\u800c\u53ef\u4ee5\u505a\u5230\u9632\u6b62\u6587\u4ef6\u88ab\u76d7\u94fe\u3002&nbsp; <\/p>\n<p>\u793a\u4f8b\u4ee3\u7801\uff1a&nbsp; <\/p>\n<p>&lt;%&nbsp; <br \/>\nFrom_url&nbsp;=&nbsp;Cstr(Request.ServerVariables(&quot;HTTP_REFERER&quot;))&nbsp; <br \/>\nServ_url&nbsp;=&nbsp;Cstr(Request.ServerVariables(&quot;SERVER_NAME&quot;))&nbsp; <br \/>\nif&nbsp;mid(From_url,8,len(Serv_url))&nbsp;&lt;&gt;&nbsp;Serv_url&nbsp;then&nbsp; <br \/>\n&nbsp;response.write&nbsp;&quot;\u975e\u6cd5\u94fe\u63a5\uff01&quot;&nbsp;&rsquo;\u9632\u6b62\u76d7\u94fe&nbsp; <br \/>\n&nbsp;response.end&nbsp; <br \/>\nend&nbsp;if&nbsp; <\/p>\n<p>if&nbsp;Request.Cookies(&quot;Logined&quot;)=&quot;&quot;&nbsp;then&nbsp; <br \/>\n&nbsp;response.redirect&nbsp;&quot;\/login.asp&quot;&nbsp;&rsquo;\u9700\u8981\u767b\u9646\uff01&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nFunction&nbsp;GetFileName(longname)&rsquo;\/folder1\/folder2\/file.asp=&gt;file.asp&nbsp; <br \/>\n&nbsp;while&nbsp;instr(longname,&quot;\/&quot;)&nbsp; <br \/>\n&nbsp;&nbsp;longname&nbsp;=&nbsp;right(longname,len(longname)-1)&nbsp; <br \/>\n&nbsp;wend&nbsp; <br \/>\n&nbsp;GetFileName&nbsp;=&nbsp;longname&nbsp; <br \/>\nEnd&nbsp;Function&nbsp; <br \/>\nDim&nbsp;Stream&nbsp; <br \/>\nDim&nbsp;Contents&nbsp; <br \/>\nDim&nbsp;FileName&nbsp; <br \/>\nDim&nbsp;TrueFileName&nbsp; <br \/>\nDim&nbsp;FileExt&nbsp; <br \/>\nConst&nbsp;adTypeBinary&nbsp;=&nbsp;1&nbsp; <br \/>\nFileName&nbsp;=&nbsp;Request.QueryString(&quot;FileName&quot;)&nbsp; <br \/>\nif&nbsp;FileName&nbsp;=&nbsp;&quot;&quot;&nbsp;Then&nbsp; <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;Response.Write&nbsp;&quot;\u65e0\u6548\u6587\u4ef6\u540d\uff01&quot;&nbsp; <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;Response.End&nbsp; <br \/>\nEnd&nbsp;if&nbsp; <br \/>\nFileExt&nbsp;=&nbsp;Mid(FileName,&nbsp;InStrRev(FileName,&nbsp;&quot;.&quot;)&nbsp;+&nbsp;1)&nbsp; <br \/>\nSelect&nbsp;Case&nbsp;UCase(FileExt)&nbsp; <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;Case&nbsp;&quot;ASP&quot;,&nbsp;&quot;ASA&quot;,&nbsp;&quot;ASPX&quot;,&nbsp;&quot;ASAX&quot;,&nbsp;&quot;MDB&quot;&nbsp; <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write&nbsp;&quot;\u975e\u6cd5\u64cd\u4f5c\uff01&quot;&nbsp; <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.End&nbsp; <br \/>\nEnd&nbsp;Select&nbsp; <br \/>\nResponse.Clear&nbsp; <br \/>\nif&nbsp;lcase(right(FileName,3))=&quot;gif&quot;&nbsp;or&nbsp;lcase(right(FileName,3))=&quot;jpg&quot;&nbsp;or&nbsp;lcase(right(FileName,3))=&quot;png&quot;&nbsp;then&nbsp; <br \/>\n&nbsp;Response.ContentType&nbsp;=&nbsp;&quot;image\/*&quot;&nbsp;&rsquo;\u5bf9\u56fe\u50cf\u6587\u4ef6\u4e0d\u51fa\u73b0\u4e0b\u8f7d\u5bf9\u8bdd\u6846&nbsp; <br \/>\nelse&nbsp; <br \/>\n&nbsp;Response.ContentType&nbsp;=&nbsp;&quot;application\/ms-download&quot;&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nResponse.AddHeader&nbsp;&quot;content-disposition&quot;,&nbsp;&quot;attachment;&nbsp;filename=&quot;&nbsp;&amp;&nbsp;GetFileName(Request.QueryString(&quot;FileName&quot;))&nbsp; <br \/>\nSet&nbsp;Stream&nbsp;=&nbsp;server.CreateObject(&quot;ADODB.Stream&quot;)&nbsp; <br \/>\nStream.Type&nbsp;=&nbsp;adTypeBinary&nbsp; <br \/>\nStream.Open&nbsp; <br \/>\nif&nbsp;lcase(right(FileName,3))=&quot;pdf&quot;&nbsp;then&nbsp;&rsquo;\u8bbe\u7f6epdf\u7c7b\u578b\u6587\u4ef6\u76ee\u5f55&nbsp; <br \/>\n&nbsp;TrueFileName&nbsp;=&nbsp;&quot;\/the_pdf_file_s\/&quot;&amp;FileName&nbsp; <br \/>\nend&nbsp;if&nbsp;&nbsp; <br \/>\nif&nbsp;lcase(right(FileName,3))=&quot;doc&quot;&nbsp;then&nbsp;&rsquo;\u8bbe\u7f6eDOC\u7c7b\u578b\u6587\u4ef6\u76ee\u5f55&nbsp; <br \/>\n&nbsp;TrueFileName&nbsp;=&nbsp;&quot;\/my_D_O_C_file\/&quot;&amp;FileName&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nif&nbsp;lcase(right(FileName,3))=&quot;gif&quot;&nbsp;or&nbsp;lcase(right(FileName,3))=&quot;jpg&quot;&nbsp;or&nbsp;lcase(right(FileName,3))=&quot;png&quot;&nbsp;then&nbsp; <br \/>\n&nbsp;TrueFileName&nbsp;=&nbsp;&quot;\/all_images_\/&quot;&amp;FileName&nbsp;&rsquo;\u8bbe\u7f6e\u56fe\u50cf\u6587\u4ef6\u76ee\u5f55&nbsp; <br \/>\nend&nbsp;if&nbsp; <br \/>\nStream.LoadFromFile&nbsp;Server.MapPath(TrueFileName)&nbsp; <br \/>\nWhile&nbsp;Not&nbsp;Stream.EOS&nbsp; <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;Response.BinaryWrite&nbsp;Stream.Read(1024&nbsp;*&nbsp;64)&nbsp; <br \/>\nWend&nbsp; <br \/>\nStream.Close&nbsp; <br \/>\nSet&nbsp;Stream&nbsp;=&nbsp;Nothing&nbsp; <br \/>\nResponse.Flush&nbsp; <br \/>\nResponse.End&nbsp; <br \/>\n%&gt;&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e00\u4e2a\u9759\u6001\u6587\u4ef6\u7684\u5b9e\u9645\u8def\u5f84\u5982\uff1ahttp:\/\/www.xx.com\/download\/3zhacom.pdf\uff0c\u5982\u679c\u670d\u52a1\u5668\u6ca1\u6709\u4f5c\u7279\u522b\u7684\u9650\u5236\u8bbe\u7f6e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u6beb\u4e0d\u8d39\u529b\u7684\u628a\u5b83\u4e0b\u8f7d\u4e0b\u6765\uff01\u5f53\u7f51\u7ad9\u63d0\u4f9b3zhacom.pdf\u4e0b\u8f7d\u65f6\uff0c\u600e\u4e48\u6837\u624d\u80fd\u8ba9\u4e0b\u8f7d&#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-201","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/201","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=201"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/201\/revisions"}],"predecessor-version":[{"id":66062,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/201\/revisions\/66062"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=201"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=201"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}