• <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),開(kāi)心的工作
            簡(jiǎn)單、開(kāi)放、平等的公司文化;尊重個(gè)性、自由與個(gè)人價(jià)值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

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

            Posted on 2009-09-21 14:34 S.l.e!ep.¢% 閱讀(589) 評(píng)論(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對(duì)中文字符求出來(lái)的值可能為負(fù)數(shù),
            ??????????? '加上65536就可求出它的無(wú)符號(hào)數(shù)值
            ??????????? '-1在機(jī)器內(nèi)是用補(bǔ)碼表示的0xffff,
            ??????????? '其無(wú)符號(hào)值為65535,65535=-1+65536
            ??????????? '其他負(fù)數(shù)依次類推。
            ???????
            ??????????? if curAsc < 0 then
            ??????????????? curAsc = curAsc + 65535
            ??????????? end if
            ???????????
            ??????????? '對(duì)中文的處理:把雙字節(jié)低位和高位分開(kāi)
            ??????????? 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

            %>

            一本色道久久综合| 国产—久久香蕉国产线看观看| 久久天天日天天操综合伊人av| 亚洲人成电影网站久久| 精品久久久久久久久免费影院| 伊人久久大香线焦综合四虎| 久久久久久久波多野结衣高潮 | 伊人久久大香线蕉影院95| 麻豆国内精品久久久久久| 久久久免费精品re6| 99久久免费国产精品特黄| 久久er99热精品一区二区| 伊人久久亚洲综合影院| 欧美一级久久久久久久大| 久久精品无码一区二区三区免费| 久久亚洲国产中v天仙www| 国内精品久久久人妻中文字幕| 97精品依人久久久大香线蕉97| 尹人香蕉久久99天天拍| 久久99中文字幕久久| 精品一区二区久久久久久久网站| 亚洲精品视频久久久| 久久99精品久久久久久9蜜桃| 欧美久久亚洲精品| 丁香五月网久久综合| 久久国产精品久久| 新狼窝色AV性久久久久久| 精品永久久福利一区二区| 国产成人综合久久精品红| 性做久久久久久免费观看 | 一级女性全黄久久生活片免费 | 久久伊人中文无码| 亚洲欧美日韩精品久久| 久久综合综合久久狠狠狠97色88 | 国产亚洲精午夜久久久久久| 韩国三级大全久久网站| 国产精品久久久久9999| 久久青青草原精品影院| 久久国产精品一区二区| 久久久综合九色合综国产| 丁香久久婷婷国产午夜视频|