<%
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.weathercn.com/forecast/24time.jsp?sta_id=59072", False
' Pull the data from the web page
xml.Send
Response.write "Here's the html we now have in our xml object"
Response.write "<BR><BR><BR>"
Response.Write "<xmp>"
Response.Write xml.responseText
Response.Write "</xmp>"
Response.write "<BR><BR><BR>"
'Response.write " Now here's how the page looks:<BR><BR>"
'Response.Write xml.responseText
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