• <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.¢% 閱讀(590) 評論(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

            %>

            欧美日韩精品久久免费| 免费一级欧美大片久久网| 色婷婷综合久久久中文字幕 | 蜜桃麻豆WWW久久囤产精品| 东方aⅴ免费观看久久av| 国产精品久久波多野结衣| 久久人人爽人人爽人人片AV东京热 | 久久人妻少妇嫩草AV蜜桃| 国内精品久久久久| 亚洲国产成人久久综合一区77| 久久精品九九亚洲精品天堂| 一级女性全黄久久生活片免费| 国产精品视频久久久| 久久九九兔免费精品6| 久久99精品久久久久久齐齐 | 无码国内精品久久综合88| 久久精品www| 国内精品伊人久久久久AV影院| 色婷婷噜噜久久国产精品12p| 精品一区二区久久| 久久99精品久久久久久久不卡| 中文字幕精品久久| 久久夜色精品国产噜噜亚洲a| 国产午夜电影久久| 久久综合九色综合久99| 精品午夜久久福利大片| 国产精品九九九久久九九| 久久精品亚洲一区二区三区浴池 | 天天做夜夜做久久做狠狠| 久久亚洲国产成人精品性色| 精品国产日韩久久亚洲| 天堂无码久久综合东京热| 亚洲国产精品综合久久一线| 久久影院午夜理论片无码| 亚洲国产成人乱码精品女人久久久不卡 | 青青青青久久精品国产h| 久久A级毛片免费观看| 国产精品美女久久久久| 国产一区二区精品久久岳| 深夜久久AAAAA级毛片免费看| 人妻少妇精品久久|