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
'然后調用XMLHTTP組件創建一個對象并進行初始化設置。
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
Function Newstring(wstr,strng) Newstring=Instr(lcase(wstr),lcase(strng)) if Newstring<=0 then Newstring=Len(wstr) End Function
'處理抓取回來的數據需要調用adodb.stream組件并進行初始化設置。%>
'以下即為頁面顯示部分
<% Dim wstr,str,url,start,over,city '定義一些需要使用到的變量
city = Request.QueryString("id") '程序傳回的ID變量(即用戶選擇的城市)賦給id