{"id":216,"date":"2008-12-05T09:37:14","date_gmt":"2008-12-05T01:37:14","guid":{"rendered":""},"modified":"2014-02-27T23:00:25","modified_gmt":"2014-02-27T15:00:25","slug":"%e4%bd%bfie%e4%b8%8b%e8%bd%bdword%e6%96%87%e6%a1%a3","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2008\/12\/05\/216.htm","title":{"rendered":"\u4f7fIE\u4e0b\u8f7dWORD\u6587\u6863"},"content":{"rendered":"<p>\u5728\u8bba\u575b\u4e2d\u6709\u5f88\u591a\u4eba\u95ee\u5230\u600e\u4e48\u5728IE\u4e2d\u8ba9\u7528\u6237\u76f4\u63a5\u4e0b\u8f7d\u5982WORD\uff0cPDF\u7b49\u8fd9\u4e9b\u6587\u4ef6\u5462?<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2aASP\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p>\u6587\u4ef6\u540d:Download.asp<\/p>\n<p>&lt;%<br \/>\nDim Stream<br \/>\nDim Contents<br \/>\nDim FileName<br \/>\nDim FileExt<br \/>\nConst adTypeBinary = 1<br \/>\nFileName = Request.QueryString(&quot;FileName&quot;)<br \/>\nif FileName = &quot;&quot; Then<br \/>\n&lt;&#8211;ubbcodetab&#8211;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&#8211;\/ubbcodetab&#8211;&gt;Response.Write &quot;\u65e0\u6548\u6587\u4ef6\u540d.&quot;<br \/>\n&lt;&#8211;ubbcodetab&#8211;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&#8211;\/ubbcodetab&#8211;&gt;Response.End<br \/>\nEnd if<br \/>\n&#8216; \u4e0b\u9762\u662f\u4e0d\u5e0c\u671b\u4e0b\u8f7d\u7684\u6587\u4ef6<br \/>\nFileExt = Mid(FileName, InStrRev(FileName, &quot;.&quot;) + 1)<br \/>\nSelect Case UCase(FileExt)<br \/>\n&lt;&#8211;ubbcodetab&#8211;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&#8211;\/ubbcodetab&#8211;&gt;Case &quot;ASP&quot;, &quot;ASA&quot;, &quot;ASPX&quot;, &quot;ASAX&quot;, &quot;MDB&quot;<br \/>\n&lt;&#8211;ubbcodetab&#8211;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&#8211;\/ubbcodetab&#8211;&gt;&lt;&#8211;ubbcodetab&#8211;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&#8211;\/ubbcodetab&#8211;&gt;Response.Write &quot;\u53d7\u4fdd\u62a4\u6587\u4ef6,\u4e0d\u80fd\u4e0b\u8f7d.&quot;<br \/>\n&lt;&#8211;ubbcodetab&#8211;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&#8211;\/ubbcodetab&#8211;&gt;&lt;&#8211;ubbcodetab&#8211;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&#8211;\/ubbcodetab&#8211;&gt;Response.End<br \/>\nEnd Select<br \/>\n&#8216; \u4e0b\u8f7d\u8fd9\u4e2a\u6587\u4ef6<br \/>\nResponse.Clear<br \/>\nResponse.ContentType = &quot;application\/octet-stream&quot;<br \/>\nResponse.AddHeader &quot;content-disposition&quot;, &quot;attachment; filename=&quot; &amp; FileName<br \/>\nSet Stream = server.CreateObject(&quot;ADODB.Stream&quot;)<br \/>\nStream.Type = adTypeBinary<br \/>\nStream.Open<br \/>\nStream.LoadFromFile Server.MapPath(FileName)<br \/>\nWhile Not Stream.EOS<br \/>\n&lt;&#8211;ubbcodetab&#8211;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;&#8211;\/ubbcodetab&#8211;&gt;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<p>&lt;&#8211;\/ubbcodetab&#8211;&gt;\u4f7f\u7528\uff1aDownload.asp?FileName=\/Files\/MY.doc<br \/>\n\u628a\u4f60\u7684DOC\u6587\u4ef6\u653e\u5230\u6839\u76ee\u5f55Files\u4e0b\uff0c\u4f60\u4e5f\u53ef\u4ee5\u653e\u5230\u5176\u5b83\u5730\u65b9\u4e86\u3002<\/p>\n<p>&lt;&#8211;ubbcodetab&#8211;&gt;&lt;&#8211;\/ubbcodetab&#8211;&gt;\u5982\uff1a<br \/>\n&lt;A HREF=&quot;Download.asp?FileName=\/Files\/MY.doc&quot;&gt;\u70b9\u51fb\u4e0b\u8f7dWORD\u6587\u6863&lt;\/A&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u8bba\u575b\u4e2d\u6709\u5f88\u591a\u4eba\u95ee\u5230\u600e\u4e48\u5728IE\u4e2d\u8ba9\u7528\u6237\u76f4\u63a5\u4e0b\u8f7d\u5982WORD\uff0cPDF\u7b49\u8fd9\u4e9b\u6587\u4ef6\u5462? \u4e0b\u9762\u662f\u4e00\u4e2aASP\u89e3\u51b3\u65b9\u6848\uff1a \u6587\u4ef6\u540d:Download.asp &lt;% Dim Stream Dim Contents Dim FileName Dim Fi&#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-216","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/216","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=216"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/216\/revisions"}],"predecessor-version":[{"id":66087,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/216\/revisions\/66087"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=216"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=216"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=216"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}