获取网络时间
系统的时间可以修改,有没有可以从网络上获取正确北京时间(包括日期)?#include <IE.au3>
$Form1 = GUICreate("", 468, 584, -1, -1)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, 12, 65, 440, 468)
GUISetState(@SW_HIDE)
_IENavigate ($oIE,"http://www.timedate.cn/worldclock/ti.asp")
$oP = _IETagNameGetCollection($oIE, 'table', 0)
MsgBox(0, "北京时间", $oP.innertext)
不错 呵呵 #Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=..\..\autoit3\Aut2Exe\Icons\TM.ico
#AutoIt3Wrapper_Compression=4
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <INet.au3>
Dim $Wkary=["日","一","二","三","四","五","六"]
$sData=_INetGetSource('http://s.time.org.cn/clock')
if @error Then
MsgBox(4096,"错误","获取网络时间出现错误!")
Exit
EndIf
$DATA = StringRegExp($sData, "=(.{1,4});", 3)
If StringLen($DATA) < 2 Then $DATA = "0" & $DATA
If StringLen($DATA) < 2 Then $DATA = "0" & $DATA
If StringLen($DATA) < 2 Then $DATA = "0" & $DATA
If StringLen($DATA) < 2 Then $DATA = "0" & $DATA
If StringLen($DATA) < 2 Then $DATA = "0" & $DATA
$Wk=Number(StringLeft($DATA,1))-1
$D_T = $DATA & "年" & $DATA & "月" & $DATA & "日" & @CRLF & "星期"&$Wkary[$Wk]& @CRLF & $DATA & ":" & $DATA & ":" & $DATA
MsgBox(4096, "北京时间", $D_T) 如果安装了sogou 或是360 浏览器,在运行时会跳出网页,请问这怎么解决呢? 呵呵。学习一下。。 #include <IE.au3>
$oIE = _IECreate ("http://www.timedate.cn/worldclock/ti.asp",0,0)
$sText = _IEBodyReadText ($oIE)
MsgBox(0, "Body Text", $sText)
页:
[1]