{"id":847,"date":"2012-12-27T23:52:48","date_gmt":"2012-12-27T15:52:48","guid":{"rendered":""},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T16:00:00","slug":"","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2012\/12\/27\/847.htm","title":{"rendered":"ASP\u9690\u85cf\u4e0b\u8f7d\u5730\u5740\u53ca\u9632\u76d7\u4ee3\u7801"},"content":{"rendered":"<p><span style=\"font-size: x-small\"><font size=\"1\">&lt;%<\/font><\/span> <span style=\"font-size: x-small\"><font size=\"1\">FunctIon DownloadFIle(StrFIle)<br \/>\nStrFIlename=StrFIle<br \/>\nResponse.Buffer=True<br \/>\nResponse.Clear<br \/>\nSet S=Server.CreateObJect(&quot;ADODB.Stream&quot;)<br \/>\nS.Open<br \/>\nS.Type=1<br \/>\non Error Resume Next<br \/>\nSet Fso=Server.CreateObJect(&quot;ScrIptIng.FIleSystemObJect&quot;)<br \/>\nIf Not Fso.FIleExists(StrFIleName) Then<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;\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\u6216\u8005\u5df2\u7ecf\u5220\u9664.&quot;<br \/>\nResponse.End<br \/>\nEnd If<br \/>\nResponse.RedIrect Request.ServerVarIables(&quot;HTTP_REFERER&quot;)<br \/>\nResponse.End<br \/>\nEnd If<br \/>\nFileExt=MId(StrFIlename,InStrRev(StrFIleName, &quot;.&quot;)+1)<br \/>\nSelect Case UCase(FIleExt)<br \/>\nCase &quot;ASP&quot;, &quot;ASA&quot;, &quot;ASPX&quot;, &quot;ASAX&quot;, &quot;MDB&quot;, &quot;PHP&quot;, &quot;JSP&quot;, &quot;SHTML&quot;, &quot;HTML&quot;, &quot;HTM&quot;, &quot;TV&quot;, &quot;DATA&quot;<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;\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\u6216\u8005\u5df2\u7ecf\u5220\u9664.&quot;<br \/>\nResponse.End<br \/>\nEnd If<br \/>\nResponse.RedIrect Request.ServerVarIables(&quot;HTTP_REFERER&quot;)<br \/>\nResponse.End<br \/>\nEnd Select<br \/>\nSet F=Fso.GetFIle(StrFIlename)<br \/>\nIntFIlelength=F.SIze<br \/>\ns.LoadFromFIle(StrFIlename)<br \/>\nIf Err Then<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;\u8be5\u6587\u4ef6\u6570\u636e\u4e0d\u5b8c\u6574\u6216\u8bb8\u5df2\u635f\u574f.&quot;<br \/>\nResponse.End<br \/>\nEnd If<br \/>\nResponse.RedIrect Request.ServerVarIables(&quot;HTTP_REFERER&quot;)<br \/>\nResponse.End<br \/>\nEnd If<br \/>\nSet Upload=Server.CreateObJect(&quot;PersIts.Upload&quot;)<br \/>\nIf Upload Is Nothing Then<br \/>\nResponse.AddHeader &quot;Content-DIsposItIon&quot;,&quot;attachment; FIlename=&quot;&amp;F.Name<br \/>\nResponse.AddHeader &quot;Content-Length&quot;,IntFilelength<br \/>\nResponse.CharSet=&quot;UTF-8&quot;<br \/>\nResponse.ContentType=&quot;application\/x-download&quot;<br \/>\nResponse.BinaryWrite S.Read<br \/>\nResponse.Flush<br \/>\nS.Close<br \/>\nSet s=NothIng<br \/>\nElse<br \/>\nUpload.SendBinary StrFIlename,True,&quot;application\/x-download&quot;,False<br \/>\nEnd If<br \/>\nEnd FunctIon<br \/>\n%&gt;<\/font><\/span><\/p>\n<p><span style=\"font-size: x-small\"><font size=\"1\">\u8c03\u7528<\/font><\/span><\/p>\n<p><span style=\"font-size: x-small\"><font size=\"1\">&lt;%Call DownloadFIle(&quot;\u4e0b\u8f7d\u5730\u5740&quot;)%&gt;<\/font><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;% FunctIon DownloadFIle(StrFIle) StrFIlename=StrFIle Response.Buffer=True Response.Clear Set S=Server.CreateObJect(&#038;&#8230;<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"topic":[],"class_list":["post-847","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/847","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"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=847"}],"version-history":[{"count":0,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/847\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=847"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=847"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}