濮阳杆衣贸易有限公司

主頁 > 知識庫 > asp通用采集函數(shù)冗余版可以保存文件到本地

asp通用采集函數(shù)冗余版可以保存文件到本地

熱門標(biāo)簽:伊春外呼業(yè)務(wù)系統(tǒng) 福建外呼增值業(yè)務(wù)線路 調(diào)度系統(tǒng)外呼 宜賓語音外呼系統(tǒng)軟件 綿陽防封電銷卡價格 河北智能外呼系統(tǒng)軟件 中國辦理電信400電話 電銷機(jī)器人源碼網(wǎng)盤下載 電銷機(jī)器人教育
%
'名稱:asp通用采集函數(shù)冗余版,要精品版的有心人自己改
'作者:柳永法
'日期:2007-6-23
Function getHTTPPage(Path)
    t = GetBody(Path)
    getHTTPPage = BytesToBstr(t, "GB2312")
End Function

Function GetBody(url)
    On Error Resume Next
    Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
    With xmlhttp
        .Open "Get", url, False, "", ""
        .Send
        .waitForResponse 1000
        GetBody = .ResponseBody
    End With
    Set xmlhttp = Nothing
End Function

Function BytesToBstr(Body, Cset)
    On Error Resume Next
    Dim objstream
    Set objstream = Server.CreateObject("adodb.stream")
    objstream.Type = 1
    objstream.Mode = 3
    objstream.Open
    objstream.Write Body
    objstream.Position = 0
    objstream.Type = 2
    objstream.Charset = Cset
    BytesToBstr = objstream.ReadText
    objstream.Close
    Set objstream = Nothing
End Function

Function getHTTPimg(url)
    On Error Resume Next
    Dim xmlhttp
    Set xmlhttp = server.CreateObject("MSXML2.XMLHTTP")
    xmlhttp.Open "GET", url, false
    xmlhttp.send()
    If xmlhttp.Status>200 Then Exit Function
    getHTTPimg = xmlhttp.responseBody
    Set xmlhttp = Nothing
    If Err.Number>0 Then Err.Clear
End Function

Function Save2Local(from, tofile)
    Dim geturl, objStream, imgs
    geturl = Trim(from)
    imgs = gethttpimg(geturl)
    Set objStream = Server.CreateObject("ADODB.Stream")
    objStream.Type = 1
    objStream.Open
    objstream.Write imgs
    objstream.SaveToFile tofile, 2
    objstream.Close()
    Set objstream = Nothing
End Function

%>

%
NowDir = server.mappath("/")
Call Save2Local("http://www.baidu.com/img/logo.gif", NowDir  "baidulogo.gif")
Call Save2Local("http://flash.jninfo.net/images/banner.swf", NowDir  "banner.swf")
Call Save2Local("https://www.jb51.net.com/", NowDir  "jb51.htmll")
response.Write getHTTPPage("https://www.jb51.net/")
%>

標(biāo)簽:那曲 銅川 延邊 蘇州 河池 電商邀評 新鄉(xiāng) 優(yōu)質(zhì)小號

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《asp通用采集函數(shù)冗余版可以保存文件到本地》,本文關(guān)鍵詞  asp,通用,采集,函數(shù),冗余,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《asp通用采集函數(shù)冗余版可以保存文件到本地》相關(guān)的同類信息!
  • 本頁收集關(guān)于asp通用采集函數(shù)冗余版可以保存文件到本地的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    新巴尔虎右旗| 元阳县| 新密市| 上饶县| 新宁县| 大宁县| 吉木乃县| 晋中市| 尚志市| 牙克石市| 西吉县| 辉南县| 郓城县| 蕉岭县| 保亭| 绍兴市| 德清县| 浦城县| 泸西县| 射阳县| 东城区| 万盛区| 汪清县| 从化市| 赞皇县| 成安县| 开鲁县| 深水埗区| 普格县| 普兰店市| 清新县| 桦南县| 泰顺县| 松江区| 江油市| 虹口区| 聂荣县| 建阳市| 广西| 永吉县| 东兰县|