晕头的判断问题,大家帮我看看在哪里加,要怎么加?
#NoTrayIcon#include <IE.au3>
$Path = IniRead("config.ini","信息","地址","")
Local $Size = InetGetSize($Path) ;我想在这里加个判断,如果在2秒内$Size>0则执行第一个命令,如果$size值等于0则执行第二个命令要怎么加?
If $Size>0 Then
Local $hDownload = InetGet($Path, "config.ini", 1, 1)
Do
Sleep(250)
Until InetGetInfo($hDownload, 2)
$IE = IniRead("config.ini","信息","主页","")
_IECreate($Ie,0,1,1,1)
EndIf
If $Size=0 Then
Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
EndIf
我想加个判断,如果在2秒内$Size>0则执行第一个命令,如果$size值等于0则执行第二个命令要怎么加? #include <IE.au3>
#NoTrayIcon
$Path = IniRead("config.ini", "信息", "地址", "")
Local $hDownload = InetGet($Path, "config.ini", 1, 1)
For $i = 0 To 20
Sleep(100)
Local $Size = InetGetInfo($hDownload, 0)
If $Size > 0 Then
Do
Sleep(10)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
$IE = IniRead("config.ini", "信息", "主页", "")
_IECreate($IE, 0, 1, 1, 1)
ExitLoop
ElseIf $i = 20 Then
InetClose($hDownload)
Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
EndIf
Next 回复 2# afan
谢谢。
#include <IE.au3>
#NoTrayIcon
$Path = IniRead("config.ini", "信息", "地址", "")
Local $hDownload = InetGet($Path, "config.ini", 1, 1)
For $i = 0 To 20
Sleep(100)
Local $Size = InetGetInfo($hDownload, 0)
If $Size > 0 Then
Do
Sleep(10)
Until InetGetInfo($hDownload, 2)
InetClose($hDownload)
$IE = IniRead("config.ini", "信息", "主页", "")
_IECreate($IE, 0, 1, 1, 1)
ExitLoop $i 这个是指时间吗?20我可以改小点不?
ElseIf $i = 20 Then
InetClose($hDownload)
Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE")
EndIf
Next $i 是指循环次数,这里设为最大 20 是因为你要求的 2 秒。(20次Sleep(100))
页:
[1]