|
''''''''''''''''''''''''''''''''''''''代碼開始''''''''''''''''''''''''''''''''''''''
'版本:V1.0
'by ten
On Error Resume Next
Set Sh = CreateObject("Wscript.Shell")
Set xmlh = CreateObject("msxml2.xmlhttp")
Set Fso = Createobject("Scripting.FileSystemObject")
if Not Fso.FileExists("C:\TB.Txt") Then
Set txt = Fso.CreateTextFile("C:\TB.Txt")
txt.writeline "[C1009通報]:"
txt.close
Set txt=nothing
End if
i = 1
j = 0
b = ""
op = True
Set txt = Fso.OpenTextFile("C:\TB.Txt",1)
kb = txt.readall
Txt.close
Set txt=nothing
Do
WScript.Sleep 3000
xmlh.open "GET","http://61.187.64.231/index.aspx?pkId=3379",False
xmlh.send
If Err.Number<>0 Then '=-2146697211 Then
WScript.Sleep 1000*60
Sh.Run Chr(34) & Wscript.ScriptFullName & Chr(34)
Exit Do
End If
x = xmlh.responseText
b = "[C1009通報]:"
While j<7
j = j+1
c = instr(i,x," ",""),vbcrlf,"")<>"[C1009通報]:" then
s=msgbox("通報有更新!" & vbcrlf & b & vbcrlf & "查看嗎?",vbYesNo)
Set txt = Fso.CreateTextFile("C:\TB.Txt")
txt.write b
txt.close
Set txt=nothing
kb=b
if s=vbyes then createobject("wscript.shell").run "http://61.187.64.231/index.aspx?pkId=3379"
End if
wscript.sleep 1000*30
If op=true Then op=False:Msgbox Weather(),64,"天氣預(yù)報"
Loop
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 = "近日天氣預(yù)報"
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
''''''''''''''''''''''''''''''''''''''代碼結(jié)束''''''''''''''''''''''''''''''''''''''
效果簡介:
檢查通報是否有更新,如果有更新就會提示你,如果沒有更新就會守在那里(這個程序基本不會占用多少CPU),一有更新就會提示你。
并附帶有自動查詢天氣預(yù)報功能。
圖:


動作簡介:
為了記住各個通報的標(biāo)題,該程序會創(chuàng)建C:\TB.txt用于記錄,若殺軟報毒是正,F(xiàn)象,加入白名單即可。
若沒有聯(lián)網(wǎng),會出現(xiàn)錯誤。
若出現(xiàn)錯誤,不會出現(xiàn)提示報錯,程序會1分鐘后自動重新運(yùn)行自己。
使用方法簡介:
將以上代碼復(fù)制,打開Notepad(記事本),粘貼。將該文件保存,然后放到 開始菜單》所有程序》啟動 文件夾下。保存時擴(kuò)展名一定要是".vbs",文件名可以隨便填。如:通報查詢.vbs,123.vbs,都可以。
下次開機(jī)時,你就可以看見效果了。
注1:僅限于C1009班通報,若需檢查其他班則需要改程序。
注2:若殺軟報毒,是誤報,加入白名單即可。(若是360報毒,純屬360的技術(shù)有問題。。。)
注3:稍作更改還可以有更多用途。
附:登陸QQ模塊。
如果你需要開機(jī)就登陸QQ,可以把下面這個過程寫進(jìn)去,然后再在適當(dāng)?shù)牡胤秸{(diào)用它。前提是你勾選了“保存密碼”。當(dāng)然,如果你沒有保存密碼,你也可以用SendKeys方法實(shí)現(xiàn)自動輸入密碼。
Sub LoginQQ()
Sh.Run Chr(34) & "E:\Program Files\Tencent\QQ\Bin\QQ.exe" & Chr(34) '啟動QQ
Do Until Sh.Appactivate("QQ2012") = True '等待QQ被啟動
WScript.Sleep 500
Loop
Sh.Appactivate("QQ2012")
WScript.Sleep 500
Sh.SendKeys "{Enter}"
End Sub
|
評分
-
查看全部評分
|