找回密码
 加入
搜索
查看: 2747|回复: 3

[系统综合] 晕头的判断问题,大家帮我看看在哪里加,要怎么加?

[复制链接]
发表于 2010-3-8 00:21:12 | 显示全部楼层 |阅读模式
#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则执行第二个命令要怎么加?
发表于 2010-3-8 02:23:36 | 显示全部楼层
#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
 楼主| 发表于 2010-3-10 13:47:40 | 显示全部楼层
回复 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
发表于 2010-3-10 15:11:32 | 显示全部楼层
$i 是指循环次数,这里设为最大 20 是因为你要求的 2 秒。(20次Sleep(100))
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-20 19:56 , Processed in 0.075629 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表