• <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

            %>

            国产午夜精品理论片久久| 久久精品国产WWW456C0M| 97久久国产综合精品女不卡| 久久精品国产2020| 97久久香蕉国产线看观看| 91麻精品国产91久久久久| 超级碰碰碰碰97久久久久| 精品国产乱码久久久久久呢 | 久久99久久99精品免视看动漫| 97久久天天综合色天天综合色hd| 久久精品国产黑森林| 狠狠色丁香久久婷婷综合| A狠狠久久蜜臀婷色中文网| 久久精品成人免费观看97| 久久午夜伦鲁片免费无码| 香蕉久久AⅤ一区二区三区| 国产精品一久久香蕉产线看| 一本色道久久综合| 91亚洲国产成人久久精品| 无码人妻精品一区二区三区久久 | 色综合久久久久综合体桃花网| 久久人人超碰精品CAOPOREN| 韩国无遮挡三级久久| 久久综合给合久久狠狠狠97色 | 精品久久无码中文字幕| 中文字幕日本人妻久久久免费| 久久99精品久久久久久不卡| 久久成人国产精品二三区| 精品久久久久久久无码 | 久久高清一级毛片| 国产精品久久网| 久久99热只有频精品8| 久久天堂AV综合合色蜜桃网 | 久久精品国产亚洲AV无码偷窥| 久久久久人妻一区二区三区| 伊色综合久久之综合久久| 亚洲国产精品综合久久网络| 中文国产成人精品久久亚洲精品AⅤ无码精品 | 国产精品久久成人影院| 97久久香蕉国产线看观看| 国产一区二区精品久久|