//获取网络时间
Private Function getWebDatetime()
Dim XmlHttp , objJs
Set XmlHttp = CreateObject("Microsoft.XMLHTTP")
XmlHttp.Open "POST", "https://www.baidu.com", False
XmlHttp.send
Set objJs = CreateObject("msscriptcontrol.scriptcontrol")
objJs.Language = "jScript"
getWebDatetime = objJs.Eval("var dt = new Date('" & XmlHttp.getResponseHeader("Date") & "');var date = [ [dt.getFullYear(), dt.getMonth() + 1, dt.getDate()].join('-'), [dt.getHours(), dt.getMinutes(), dt.getSeconds()].join(':')].join(' ').replace(/(?=\b\d\b)/g, '0');date;")
Set XmlHttp = Nothing
Set objJs = Nothing
End Function
TracePrint "距有效期还有:"&DateDiff("d", getWebDatetime(), "2018-02-01")
if DateDiff("d", getWebDatetime(), "2018-02-01")>0 Then
Call fs()
Else
MessageBox "软件已过期,请联系作者获取最新版本!"
End If