返回列表 发帖
本帖最后由 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 FunctionCOPY
#2F
Line 19
regNum = Int(objREG.Execute(objStr)(0).Submatches(0)) /1000
If regNum = "" Or regNum = 0 Then
  Msgbox "无法获取在线时间数据。"
  WScript.Quit
End IfCOPY
Self testing.
『千江有水千江月』千江有水,月映千江;万里无云,万里青天。    http://yu2n.qiniudn.com/

TOP

返回列表