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

            %>

            午夜精品久久久久| 久久91综合国产91久久精品| 欧美一级久久久久久久大| 久久久久av无码免费网| 好属妞这里只有精品久久| 日本精品久久久久影院日本| 精品人妻久久久久久888| 久久se精品一区精品二区国产| 久久毛片一区二区| 99久久精品国产综合一区| 国产成人久久精品一区二区三区| 亚洲国产精品一区二区久久| 无码人妻久久一区二区三区蜜桃 | 人妻少妇精品久久| 国内精品九九久久久精品| 久久久精品久久久久影院| 99久久伊人精品综合观看| WWW婷婷AV久久久影片| 婷婷五月深深久久精品| 欧美久久天天综合香蕉伊| 色综合久久天天综合| 91精品国产综合久久精品| 久久无码专区国产精品发布| 性高湖久久久久久久久AAAAA| 国产成人久久精品麻豆一区| 久久天天躁狠狠躁夜夜躁2O2O| 久久综合偷偷噜噜噜色| 思思久久99热免费精品6| 色婷婷噜噜久久国产精品12p | 久久免费小视频| 久久国产精品久久国产精品| 久久精品人人做人人爽电影| 国产精品久久成人影院| 久久久久久久综合日本亚洲| 97超级碰碰碰久久久久| 久久精品国产亚洲沈樵| 狠狠色婷婷综合天天久久丁香| 久久r热这里有精品视频| 久久久久久久综合日本亚洲| 久久99国产精品久久99| 国产成人久久久精品二区三区|