{"id":349,"date":"2009-01-08T10:04:31","date_gmt":"2009-01-08T02:04:31","guid":{"rendered":""},"modified":"2014-02-27T23:06:04","modified_gmt":"2014-02-27T15:06:04","slug":"asp%e9%98%b2%e7%9b%97%e9%93%be","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2009\/01\/08\/349.htm","title":{"rendered":"asp\u9632\u76d7\u94fe"},"content":{"rendered":"<p>&lt;%<br \/>\nFrom_url = Cstr(Request.ServerVariables(&quot;HTTP_REFERER&quot;))<br \/>\nServ_url = Cstr(Request.ServerVariables(&quot;SERVER_NAME&quot;))<br \/>\nif mid(From_url,8,len(Serv_url)) &lt;&gt; Serv_url then<br \/>\nresponse.write &quot;\u975e\u6cd5\u94fe\u63a5\uff01&quot; &#8216;\u9632\u6b62\u76d7\u94fe<br \/>\nresponse.end<br \/>\nend if<\/p>\n<p>if Request.Cookies(&quot;Logined&quot;)=&quot;&quot; then<br \/>\nresponse.redirect &quot;\/login.asp&quot; &#8216;\u9700\u8981\u767b\u9646\uff01<br \/>\nend if<br \/>\nFunction GetFileName(longname)&#8217;\/folder1\/folder2\/file.asp=&gt;file.asp<br \/>\nwhile instr(longname,&quot;\/&quot;)<br \/>\nlongname = right(longname,len(longname)-1)<br \/>\nwend<br \/>\nGetFileName = longname<br \/>\nEnd Function<br \/>\nDim Stream<br \/>\nDim Contents<br \/>\nDim FileName<br \/>\nDim TrueFileName<br \/>\nDim FileExt<br \/>\nConst adTypeBinary = 1<br \/>\nFileName = Request.QueryString(&quot;FileName&quot;)<br \/>\nif FileName = &quot;&quot; Then<br \/>\n&nbsp;&nbsp;&nbsp; Response.Write &quot;\u65e0\u6548\u6587\u4ef6\u540d\uff01&quot;<br \/>\n&nbsp;&nbsp;&nbsp; Response.End<br \/>\nEnd if<br \/>\nFileExt = Mid(FileName, InStrRev(FileName, &quot;.&quot;) + 1)<br \/>\nSelect Case UCase(FileExt)<br \/>\n&nbsp;&nbsp;&nbsp; Case &quot;ASP&quot;, &quot;ASA&quot;, &quot;ASPX&quot;, &quot;ASAX&quot;, &quot;MDB&quot;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.Write &quot;\u975e\u6cd5\u64cd\u4f5c\uff01&quot;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.End<br \/>\nEnd Select<br \/>\nResponse.Clear<br \/>\nif lcase(right(FileName,3))=&quot;gif&quot; or lcase(right(FileName,3))=&quot;jpg&quot; or lcase(right(FileName,3))=&quot;png&quot; then<br \/>\nResponse.ContentType = &quot;image\/*&quot; &#8216;\u5bf9\u56fe\u50cf\u6587\u4ef6\u4e0d\u51fa\u73b0\u4e0b\u8f7d\u5bf9\u8bdd\u6846<br \/>\nelse<br \/>\nResponse.ContentType = &quot;application\/ms-download&quot;<br \/>\nend if<br \/>\nResponse.AddHeader &quot;content-disposition&quot;, &quot;attachment; filename=&quot; &amp; GetFileName(Request.QueryString(&quot;FileName&quot;))<br \/>\nSet Stream = server.CreateObject(&quot;ADODB.Stream&quot;)<br \/>\nStream.Type = adTypeBinary<br \/>\nStream.Open<br \/>\nif lcase(right(FileName,3))=&quot;pdf&quot; then &#8216;\u8bbe\u7f6epdf\u7c7b\u578b\u6587\u4ef6\u76ee\u5f55<br \/>\nTrueFileName = &quot;\/the_pdf_file_s\/&quot;&amp;FileName<br \/>\nend if <br \/>\nif lcase(right(FileName,3))=&quot;doc&quot; then &#8216;\u8bbe\u7f6eDOC\u7c7b\u578b\u6587\u4ef6\u76ee\u5f55<br \/>\nTrueFileName = &quot;\/my_D_O_C_file\/&quot;&amp;FileName<br \/>\nend if<br \/>\nif lcase(right(FileName,3))=&quot;gif&quot; or lcase(right(FileName,3))=&quot;jpg&quot; or lcase(right(FileName,3))=&quot;png&quot; then<br \/>\nTrueFileName = &quot;\/all_images_\/&quot;&amp;FileName &#8216;\u8bbe\u7f6e\u56fe\u50cf\u6587\u4ef6\u76ee\u5f55<br \/>\nend if<br \/>\nStream.LoadFromFile Server.MapPath(TrueFileName)<br \/>\nWhile Not Stream.EOS<br \/>\n&nbsp;&nbsp;&nbsp; Response.BinaryWrite Stream.Read(1024 * 64)<br \/>\nWend<br \/>\nStream.Close<br \/>\nSet Stream = Nothing<br \/>\nResponse.Flush<br \/>\nResponse.End<br \/>\n%&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;% From_url = Cstr(Request.ServerVariables(&quot;HTTP_REFERER&quot;)) Serv_url = Cstr(Request.ServerVariables(&quot;S&#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-349","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/349","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=349"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/349\/revisions"}],"predecessor-version":[{"id":66195,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/349\/revisions\/66195"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=349"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=349"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=349"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}