久久久久久久性爱潮,国产又粗又猛又爽又黄下载视频,尤物国产在线一区视频,欧美日本国产在线不卡

<sup id="4uqqy"><ol id="4uqqy"></ol></sup>
  • <th id="4uqqy"></th>

      • <strike id="4uqqy"><nobr id="4uqqy"><ins id="4uqqy"></ins></nobr></strike><sup id="4uqqy"></sup><strong id="4uqqy"><u id="4uqqy"></u></strong>
        <sub id="4uqqy"></sub>

          綠色資源網(wǎng):您身邊最放心的安全下載站! 最新軟件|熱門排行|軟件分類|軟件專題|廠商大全

          綠色資源網(wǎng)

          技術(shù)教程
          您的位置:首頁網(wǎng)絡(luò)編程Xml編程 → xmlhttp組件獲取遠(yuǎn)程文件并篩選出目標(biāo)數(shù)據(jù)

          xmlhttp組件獲取遠(yuǎn)程文件并篩選出目標(biāo)數(shù)據(jù)

          我要評(píng)論 2010/02/16 19:11:44 來源:綠色資源網(wǎng) 編輯:綠色資源站 [ ] 評(píng)論:0 點(diǎn)擊:292次

          getfile.asp
          <%
          ''利用xmlhttp組件獲取遠(yuǎn)程文件保存到當(dāng)前空間
          ''此是網(wǎng)站建設(shè)中的一個(gè)實(shí)例,遠(yuǎn)程獲取一個(gè)網(wǎng)頁內(nèi)容并篩選出相關(guān)的天氣數(shù)據(jù),當(dāng)然可以跳過文件本地存儲(chǔ)再獲取數(shù)據(jù)
          ''參考了xoyu的函數(shù),在此感謝
          fileurl="http://www.hbqx.gov.cn/other/tqyb/inc_city_hb.asp"
          dotloc=InStrRev(fileurl,".")
          filepath="thistest"&mid(fileurl,dotloc) ''建立同類型文件名
          ''filepath="thistest.htm"

          call saveRemoteFile(filepath,fileurl)

          sub SaveRemoteFile(LocalFileName,RemoteFileUrl)
          dim Ads,Retrieval,GetRemoteData
          Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
          With Retrieval
          .Open "Get", RemoteFileUrl, False, "", ""
          .Send
          GetRemoteData = .ResponseBody
          '' GetDetail = .ResponseText ''對(duì)文本型文件可直接獲取內(nèi)容,但不能支持中文,不知道如何解決
          End With

          Set Retrieval = Nothing
          ''RESPONSE.WRITE GetDetail

          Set Ads = Server.CreateObject("Adodb.Stream") ''生成對(duì)應(yīng)文件
          With Ads
          .Type = 1
          .Open
          .Write GetRemoteData
          .SaveToFile server.MapPath(LocalFileName),2
          .Cancel()
          .Close()
          End With
          Set Ads=nothing
          end sub

          ''以上完成遠(yuǎn)程存儲(chǔ)文件,以下只適用于對(duì)文本型文件的操作
          set fso=server.createobject("scripting.filesystemobject") ''讀取文件內(nèi)容
          set fileout=fso.opentextfile(server.mappath(filepath),1)
          content=fileout.readall
          set fileout=nothing
          set fso=nothing
          ''response.write content

          contentarr=split(content,"<td") ''根據(jù)內(nèi)容進(jìn)行篩選
          for i=1 to ubound(contentarr)
          if instr(contentarr(i),"恩施") then thisloc=i
          next
          dim xu(5)
          for j=0 to 4
          con1=contentarr(thisloc+j)
          start1=instr(con1,">")
          con1=right(con1,len(con1)-start1)
          stop1=instr(con1,"<")
          con1=left(con1,stop1-1)
          str=str&contentarr(thisloc+j)
          xu(j)=trim(con1)
          next
          if xu(1)<>"" then
          response.write "document.write('恩施州未來24小時(shí)天氣預(yù)報(bào):"&xu(1)&",最低溫度"&xu(2)&"攝氏度,最高溫度"&xu(3)&"攝氏度,風(fēng)向:"&xu(4)&".--武漢中心氣象臺(tái)發(fā)布');"
          else
          response.write "document.write('暫未發(fā)布');"
          end if
          ''response.write server.htmlencode(str)
          %>

          在另一個(gè)htm頁中引用顯示獲取內(nèi)容
          <script src="getfile.asp"></script>

          關(guān)鍵詞:xmlhttp組件

          閱讀本文后您有什么感想? 已有 人給出評(píng)價(jià)!

          • 1 歡迎喜歡
          • 1 白癡
          • 1 拜托
          • 1 哇
          • 1 加油
          • 1 鄙視