本帖最后由 yu2n 于 2015-1-21 22:17 编辑
#1F
Line 6- Function getBaiduTime()
- On Error Resume Next
- Dim strUrl, strText
- strUrl = "http://open.baidu.com/special/time/"
- With CreateObject("MSXML2.XmlHttp")
- .Open "GET", strUrl, False
- .Send()
- strText = CStr(.responseText)
- End With
- If Err.Number <> 0 Or InStr(strText,"window.baidu_time(")<1 Then
- Msgbox "Error.getBaiduTime() 无法获取在线时间数据。"
- WScript.Quit
- End If
- strText = Split(LCase(strText), "window.baidu_time(")(1)
- getBaiduTime = Int(Left(strText, 13)/1000)
- End Function
复制代码 #2F
Line 19- regNum = Int(objREG.Execute(objStr)(0).Submatches(0)) /1000
- If regNum = "" Or regNum = 0 Then
- Msgbox "无法获取在线时间数据。"
- WScript.Quit
- End If
复制代码 Self testing. |