[Original] Get weather forecast information

xiaoxiao2021-03-06  34

http://community.9cbs.net/expert/topic/3720/3720043.xml?temp=.9098169

City: province: < Input name = province value = 'Heilongjiang'> <% if Request ("city") <> "" "= request (" city ") Area = Request ("Area") province = request ("province") contents = gethttppage ("http://www.cma.gov.cn/netcenter_news/qxyb/city/index.php?city=" & city "& province = "& provvice &" & area = "& area) StartPOS = CutedPage (Contents," ", 1) endpos = cutedpage (contents," , 0) Contents = MID (Contents, StartPos, Endpos-StartPOS) Contents = Replace (Contents, "SRC = /", "SRC = http://www.cma.gov.cn/") Contents = Replace (Contents, "SRC = .. "," src = http://www.cma.gov.cn/netcenter_news/qxyb/city/ .. ") Response.write ContentSend IF

Function CutedPage (Scontent, Str, Mode) if scontent = "" "" "" "" "SCONTENT, STR) if Pos> = 0 Then if Mode = 0 THEN CUTEDPAGE = POS else CutedPage = POS LEN (STR) end if Else CutePage = LEN (SCONTENT) End if End Function

Function Bytes2Bstr2 (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 Bytes2Bstr2 = objstream.ReadText objstream.Close set objstream = nothing End Functionfunction getHTTPPage (url) on error resume next dim http set http = server.createobject ( "Microsoft.XMLHTTP") Http.open "GET", url, False http.send () if http.readystate <> 4 THENETES2BSTTTTPPAGE = bytes2bstr2 (http.responsebody, "gb2312") set http = Nothing if err.number <> 0 Then Err.clear End function%>

转载请注明原文地址:https://www.9cbs.com/read-67426.html

New Post(0)