找回密码
 加入
搜索
查看: 1642|回复: 0

[AU3基础] 求助,本人想写一个根据关键字关闭程序的代码,测试失败,求助

[复制链接]
发表于 2015-2-6 23:29:43 | 显示全部楼层 |阅读模式
代码如下:
#include <Misc.au3>
#include <Process.au3>
HotKeySet("!{ESC}", "ext")
While 1
        $INI = @ScriptDir & "\rh.ini"
        $tt1 = IniRead($INI, "t1", "cmd.exe", "")
        $tt2 = IniRead($INI, "t2", "iexplore.exe", "")
        $tt3 = IniRead($INI, "t3", "qq.exe", "")
        $tt4 = IniRead($INI, "t4", "pplive.exe", "")
        If FileExists($INI) Then
        Else
                IniRead($INI, "t1", "cmd.exe", "")
                IniRead($INI, "t2", "iexplore.exe", "")
                IniRead($INI, "t3", "qq.exe", "")
                IniRead($INI, "t4", "pplive.exe", "")
        EndIf
        Sleep(1000) ;1000 等于1秒
WEnd
ProcessClose ( '&$tt1&' )
ProcessClose ( '&$tt2&' )
ProcessClose ( '&$tt3&' )
ProcessClose ( '&$tt4&' )
Func ext()
        Exit
EndFunc   ;==>ext

现在的问题是代码测试运行,不报错,但是不生成rh.ini文件
也不关闭程序.
求助,怎么修改才好。
如果我想完善,怎么才能达到比如在ini文件中写入
关键字
T1=武媚娘
进程=iexplore.exe
T2=PPLIVE
进程=pplive.exe
最高可支持5个自定义进程
每60秒循环一次
发现关键字 就直接结束进程
。。那个高手能告诉我下,应该怎么做,最好能把代码贴出来,我刚开始学没多久,望理解。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 14:17 , Processed in 0.072550 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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