找回密码
 加入
搜索
查看: 2577|回复: 8

do...Until的问题,请大家帮忙看啊可能[感谢版主pcbar]

[复制链接]
发表于 2008-8-3 07:52:41 | 显示全部楼层 |阅读模式
我想当没有TSingVision.exe的时候退出自身.
有则继续loing().
大家看这样写有什么问题吗?
我运行发现无法退出自己.....
因为程序TSingVision.exe有不少地方要Login()
所以只能循环直到用户关闭
run ("D:\Program Files\Ymnetwork\DVR\TSingVision.exe")

Do
login()
$S1=ProcessExists ("TSingVision.exe")
Until $S1 = ("0")
Exit

Func login()
WinWait("DVR    用户验证","")
send("ym")
send("{Tab}")
send("ym")
send("{enter}")
EndFunc


[ 本帖最后由 l4ever 于 2008-8-5 01:31 编辑 ]
发表于 2008-8-3 08:11:07 | 显示全部楼层
While 1
        $S1 = ProcessExists("TSingVision.exe")
        If $S1 = 0 Then
                ExitLoop
        Else
                login ()
        EndIf
WEnd
发表于 2008-8-3 15:33:51 | 显示全部楼层
run ("D:\Program Files\Ymnetwork\DVR\TSingVision.exe")

Do
login()
Until ProcessExists ("TSingVision.exe") = 0 
Exit

Func login()
WinWait("DVR    用户验证","")
send("ym")
send("{Tab}")
send("ym")
send("{enter}")
EndFunc
 楼主| 发表于 2008-8-3 21:37:39 | 显示全部楼层
谢谢LS两位,可是进程TSingVision.exe没有了,程序还不推出去
发表于 2008-8-3 21:55:57 | 显示全部楼层
Until Not ProcessExists ("TSingVision.exe") 
发表于 2008-8-3 22:46:42 | 显示全部楼层
试试
run ("D:\Program Files\Ymnetwork\DVR\TSingVision.exe")

Do
login()
$S1=ProcessExists ("TSingVision.exe")
Until $S1 = ("0")
Exit

Func login()
WinWait("DVR    用户验证",3)
send("ym")
send("{Tab}")
send("ym")
send("{enter}")
EndFunc
 楼主| 发表于 2008-8-3 23:21:47 | 显示全部楼层
回LS两位,还是不行.
发表于 2008-8-4 01:07:12 | 显示全部楼层
Do
        ConsoleWrite("1")
Until ProcessExists("notepad.exe") = 0
试试可行
发表于 2008-8-4 20:08:00 | 显示全部楼层
没有tsingvision程序,无法测试,请再试
run ("D:\Program Files\Ymnetwork\DVR\TSingVision.exe")

Do
login()
Until not ProcessExists ("TSingVision.exe")
Exit

Func login()
if WinWait("DVR","",5)=0 then Return
send("ym")
send("{Tab}")
send("ym")
send("{enter}")
EndFunc

[ 本帖最后由 pcbar 于 2008-8-4 20:10 编辑 ]
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-4 13:31 , Processed in 0.077323 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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