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

            %>

            亚洲国产一成人久久精品| 精品永久久福利一区二区| 亚洲国产精品高清久久久| 蜜桃麻豆WWW久久囤产精品| 无码8090精品久久一区| 日批日出水久久亚洲精品tv| 日日狠狠久久偷偷色综合免费| 亚洲国产成人久久一区久久| 国产69精品久久久久9999APGF | 一本大道加勒比久久综合| 久久精品国产99久久久香蕉| 四虎国产精品成人免费久久| 久久丫精品国产亚洲av不卡| 一本久久a久久精品综合香蕉| 亚洲国产精品久久久天堂| 精品人妻伦九区久久AAA片69| 狠狠干狠狠久久| 亚洲欧美另类日本久久国产真实乱对白 | 2021最新久久久视精品爱| 久久精品9988| 99久久精品免费看国产一区二区三区| 久久精品a亚洲国产v高清不卡| 午夜精品久久久久成人| AV无码久久久久不卡蜜桃| 久久精品国产2020| 久久人妻少妇嫩草AV蜜桃| 久久久久久a亚洲欧洲aⅴ | 久久久噜噜噜久久中文福利| 色偷偷88欧美精品久久久| 国产精品久久久久影院色| 久久国产热精品波多野结衣AV| 久久996热精品xxxx| 91久久婷婷国产综合精品青草| 久久精品中文字幕一区| 久久亚洲AV无码西西人体| 久久性生大片免费观看性| 69国产成人综合久久精品| 久久久久久久亚洲Av无码| 亚洲国产另类久久久精品黑人 | 中文字幕亚洲综合久久| 亚洲人成网站999久久久综合|