欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標題: VBScript獲得天氣預報的函數 [打印本頁]

作者: 51hei麗人    時間: 2016-6-20 23:13
標題: VBScript獲得天氣預報的函數
Set xmlh = CreateObject("msxml2.xmlhttp")         ‘需要聲明的對象
Function Weather()
        xmlh.open "GET","http://www.baidu.com/s?wd=%CC%EC%C6%F8&f=12&rsp=0&oq=tianqi&tn=baiduhome_pg",False
        xmlh.send
        html = xmlh.responseText
        str_temp = "</a></div><strong altemp_special" & Chr(34) & ">"
        a = InStr(html,str_temp) + Len(str_temp)
        b = InStr(a,html,"</strong><br><strong>")
        c = b + Len("</strong><br><strong>")
        d = InStr(c,html,"</strong><br><span>")
        Today_Temp = Mid(html,a,b - a)
        Today_Weather = Mid(html,c,d - c)
        Today_Wind = Mid(html,d + Len("</strong><br><span>"),InStr(d,html,"</span></td>") - (d + Len("</strong><br><span>")))
        a = InStr(d,html,"</a></div>") + Len("</a></div>")
        b = InStr(a,html,"<br>")
        c = InStr(b + 4,html,"<br><span>")
        Tomorrow_Weather = Mid(html,b + 4,c - b - 4)
        Tomorrow_Temp = Mid(html,a,b - a)
        Tomorrow_Wind = Mid(html,c + Len("<br><span>"),InStr(c,html,"</span></td>") - (c + Len("<br><span>")))
        a = InStr(c,html,"</a></div>") + Len("</a></div>")
        b = InStr(a,html,"<br>")
        c = InStr(b + 4,html,"<br><span>")
        the_weather = Mid(html,b + 4,c - b - 4)
        the_Temp = Mid(html,a,b - a)
        The_Wind = Mid(html,c + Len("<br><span>"),InStr(c,html,"</span></td>") - (c + Len("<br><span>")))
        Line1 = "近日天氣預報"
        Line2 = "今日" & today_temp & "," & today_weather & "," & today_wind
        Line3 = "明日" & tomorrow_temp & "," & tomorrow_weather & "," & tomorrow_wind
        Line4 = "后天" & the_temp & "," & the_weather & "," & the_wind
        Weather = line1 & vbCrLf & line2 & vbCrLf & line3 & vbCrLf & line4
End Function

Msgbox Weather()
’返回值就是天氣預報








歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1