|
| 您的位置: 首頁 > 網(wǎng)站資訊 > 獲取遠程網(wǎng)頁內(nèi)容實例代碼 |
獲取遠程網(wǎng)頁內(nèi)容實例代碼發(fā)布日期:2017/7/13
Function getHTTPPage(url) 'Asp 獲取遠程網(wǎng)頁內(nèi)容實例代碼 dim http set http=Server.createobject("Microsoft.XMLHTTP")'建立XMLHTTP對象 Http.open "GET",url,false '設(shè)置http對象打開體例 GET體例,URL[連接頁面地址],同步處理 Http.send() '發(fā)送請求 if Http.readystate<>4 then'對象處理狀況為 非結(jié)束 exit function '退出函數(shù) end if getHTTPPage=bytesToBSTR(Http.responseBody,"gb2312")'BytesToBstr獲取的源碼轉(zhuǎn)換為中文的代碼 set http=nothing '消滅對象 if err.number<>0 then err.Clear '消滅錯誤 End function '================================================== |
| 其他相關(guān)文章 |
|
|
|
|
||||||||
| Copyright 2012-2025 上海蒙狼網(wǎng)絡(luò)科技有限公司 www.zyjjkqf.com All Rights Reserved |