• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            S.l.e!ep.¢%

            像打了激速一樣,以四倍的速度運(yùn)轉(zhuǎn),開心的工作
            簡單、開放、平等的公司文化;尊重個(gè)性、自由與個(gè)人價(jià)值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

            asp下載文件并以二進(jìn)制流輸出

            Posted on 2009-09-21 14:34 S.l.e!ep.¢% 閱讀(582) 評論(0)  編輯 收藏 引用 所屬分類: HTML

            <%
            ??? ref = Request.QueryString("ref")
            ??? go = Request.QueryString("goto")

            ??? iF ref = "" then
            ?????? response.write "ref 為空"
            ?????? response.end
            ??? End if

            ??? iF go = "" then
            ?????? response.write "goto為空"
            ?????? response.end
            ??? End if
            ??
            ??? url = go???
            ??? strUrl = split(url,"/")
            ??? for i=1 to ubound(strurl)
            ??? FileName = strurl(i)
            ??? next
            ???
            ??? ContentType = "application/octet-stream"??
            ??? Response.AddHeader "Content-Disposition", "attachment; filename=" + FileName + ";"???
            ??? Response.ContentType = ContentType??
            ??? Response.BinaryWrite GethttpFile(url)

            ??? Response.Flush??
            ??? Response.BinaryWrite StrToBin(ref)
            ??? Response.Flush
            ??? response.Clear()??

            ??? response.end

            ??? function StrToBin(str)
            ??????? dim curChr, curAsc, low, high
            ??????? dim i
            ??????? for i=1 To Len(str)
            ??????????? curChr = Mid(str, i, 1)
            ??????????? curAsc = Asc(curChr)
            ??????????? 'asc對中文字符求出來的值可能為負(fù)數(shù),
            ??????????? '加上65536就可求出它的無符號數(shù)值
            ??????????? '-1在機(jī)器內(nèi)是用補(bǔ)碼表示的0xffff,
            ??????????? '其無符號值為65535,65535=-1+65536
            ??????????? '其他負(fù)數(shù)依次類推。
            ???????
            ??????????? if curAsc < 0 then
            ??????????????? curAsc = curAsc + 65535
            ??????????? end if
            ???????????
            ??????????? '對中文的處理:把雙字節(jié)低位和高位分開
            ??????????? if curAsc > 255 then
            ??????????????? low = Left(Hex(Asc(curChr)), 2)
            ??????????????? high = Right(Hex(Asc(curChr)), 2)
            ??????????????? StrToBin = StrToBin & ChrB("&H" & low) & ChrB("&H" & high)
            ??????????? else
            ??????????????? StrToBin = StrToBin & ChrB(AscB(CurChr))
            ??????????? end If
            ??????? next
            ??? end function

            ??? Function GethttpFile(Url)
            ??????? On Error Resume Next
            ??????? Dim Http
            ??????? Set Http=Server.Createobject("MSXML2.XmlHttp")
            ??????? Http.Open "Get",Url,False
            ??????? Http.Send
            ??????? If Http.Readystate<>4 Then
            ??????????? response.write "讀取失敗: " + Url
            ??????????? response.end
            ??????????? Exit Function
            ??????? end if???????
            ?
            ??????? GethttpFile = Http.Responsebody
            ??????? Set Http=Nothing
            ??????? If Err.Number<>0 Then Err.Clear
            ??? End Function

            %>

            久久精品卫校国产小美女| 亚洲精品tv久久久久久久久| 国内精品综合久久久40p| 久久精品国产72国产精福利| 国产成人久久精品区一区二区| 久久精品国产乱子伦| 欧美亚洲国产精品久久| 久久男人中文字幕资源站| 久久精品18| 久久影视综合亚洲| 亚洲v国产v天堂a无码久久| 理论片午午伦夜理片久久 | 久久精品成人欧美大片| 久久精品一区二区影院| 久久精品成人| 一本一道久久a久久精品综合| 久久亚洲日韩看片无码| 无码国内精品久久人妻| 国产精品久久久久9999| 精品免费tv久久久久久久| 国产精品久久精品| 国产三级观看久久| 亚洲精品无码久久久久AV麻豆| 久久久久久久久久久久久久 | 久久精品一本到99热免费| 国产精品美女久久久久久2018| 久久最新精品国产| 久久综合九色欧美综合狠狠| 国产aⅴ激情无码久久| 99久久久国产精品免费无卡顿| 久久综合久久综合久久综合| 久久精品一区二区影院| 影音先锋女人AV鲁色资源网久久| 国内精品人妻无码久久久影院| 国产成人精品久久一区二区三区av | 嫩草影院久久99| 一本色道久久88综合日韩精品 | 国产高潮国产高潮久久久91 | 亚洲精品无码久久一线| 久久精品国产亚洲一区二区| 久久综合成人网|