国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

提供幾個關于采集的函數(ASP)

2024-05-04 11:04:57
字體:
來源:轉載
供稿:網友

''''''''''''''''斷劍注釋'''''''''''''''''''''''''
''''strText為要切取內容的那段打的內容''''''''''''
''''strStarTag為要切取內容的開始的地方''''''''''
''''strEndTag為要切取內容的結束的地方''''''''''
''''GetText返回值為切取出來的內容''''''''''''''
'''''''''''''''注釋結束''''''''''''''''''''''''
Function GetText(strText, strStartTag, strEndTag)
dim intStart
intStart = instr(strText, strStartTag)
if intStart then
intStart = intStart + len(strStartTag)
intEnd = InStr(intStart, strText, strEndTag)
GetText = Mid(strText, intStart, intEnd - intStart)
else
GetText = " "
end if
End Function

%>
'''''''''斷劍注釋''''''''''''
'''''''''以下的函數都可以不管'''''''''
''''''''只管入口函數getHTTPPage'''''''
''''''''path為要讀取的網頁地址''''''''
''''''''getHTTPPage返回讀取到的網頁內容''
''''''''這里應該注意的是gb2312這里,如果被讀取的網頁編碼是
''gb2312就用gb2312,如果是UTF-8的話,就換成UTF-8''''
''''''''注釋結束''''''''''
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"gb2312")
End function

Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body,Cset)
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
%>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巴楚县| 灵宝市| 隆尧县| 汝州市| 巴林左旗| 从化市| 屏东县| 平顶山市| 徐汇区| 会理县| 萨迦县| 尤溪县| 陈巴尔虎旗| 古交市| 武乡县| 正镶白旗| 汉川市| 永登县| 哈尔滨市| 龙里县| 岐山县| 武夷山市| 凉城县| 金山区| 贞丰县| 鸡泽县| 德化县| 湘潭县| 桑日县| 昔阳县| 盐亭县| 蓬莱市| 东明县| 湖南省| 延津县| 扶绥县| 固阳县| 凌海市| 西安市| 遂昌县| 三亚市|