• <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.¢%

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

            asp下載文件并以二進制流輸出

            Posted on 2009-09-21 14:34 S.l.e!ep.¢% 閱讀(588) 評論(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對中文字符求出來的值可能為負數,
            ??????????? '加上65536就可求出它的無符號數值
            ??????????? '-1在機器內是用補碼表示的0xffff,
            ??????????? '其無符號值為65535,65535=-1+65536
            ??????????? '其他負數依次類推。
            ???????
            ??????????? if curAsc < 0 then
            ??????????????? curAsc = curAsc + 65535
            ??????????? end if
            ???????????
            ??????????? '對中文的處理:把雙字節低位和高位分開
            ??????????? 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

            %>

            久久99精品国产麻豆婷婷| 一本综合久久国产二区| 久久97精品久久久久久久不卡| 久久久精品午夜免费不卡| 久久福利片| 国产精品免费看久久久| 久久久艹| 久久国产高清字幕中文| 伊人久久大香线蕉成人| 亚洲精品高清国产一久久| 亚洲精品高清国产一线久久| 久久久无码精品午夜| 91视频国产91久久久| 亚洲欧洲日产国码无码久久99| 国内精品欧美久久精品| 久久久久久久人妻无码中文字幕爆 | 一本色道久久88精品综合| 91久久精品视频| 久久99国产综合精品女同| 人人妻久久人人澡人人爽人人精品 | 97精品国产97久久久久久免费 | 久久国产精品国产自线拍免费| 亚洲国产精品无码久久一区二区| 久久综合九色欧美综合狠狠 | 色8久久人人97超碰香蕉987| 日产久久强奸免费的看| 国产精品一区二区久久精品无码| 2021久久国自产拍精品| 91精品国产综合久久精品| 国产精品女同久久久久电影院| 欧美黑人激情性久久| 久久久国产打桩机| 狠狠色婷婷久久一区二区| 欧美亚洲国产精品久久高清| 久久久亚洲裙底偷窥综合| 亚洲精品乱码久久久久久久久久久久| 久久99九九国产免费看小说| 久久久精品人妻一区二区三区蜜桃| 2021国产精品久久精品| 亚洲日韩中文无码久久| 久久国产免费观看精品3|