找回密码
 加入
搜索
查看: 2235|回复: 6

想做一个监控进程的谁能给个代码

[复制链接]
发表于 2009-7-19 18:29:14 | 显示全部楼层 |阅读模式
我想做一个监控进程的程序~要进程结束就发个邮件~偶这类代码吗?
发表于 2009-7-19 19:24:22 | 显示全部楼层
#include <Process.au3>
#include <INet.au3>

ProcessClose("notepad.exe")
$PID = ProcessExists("notepad.exe") ; 返回记事本程序的 PID,若未发现该进程则返回值为 0。
If $PID Then ProcessClose($PID)
$Address = InputBox('Address', 'Enter the E-Mail address to send message to')
$Subject = InputBox('Subject', 'Enter a subject for the E-Mail')
$Body = InputBox('Body', 'Enter the body (message) of the E-Mail')
MsgBox(0,'E-Mail has been opened','The E-Mail has been opened and process identifier for the E-Mail client is ' & _INetMail($address, $subject, $body))
发表于 2009-7-19 19:25:33 | 显示全部楼层
If ProcessExists("notepad.exe") Then
    MsgBox(0, "示例", "记事本运行中。")
EndIf
 楼主| 发表于 2009-7-20 10:51:26 | 显示全部楼层
那进程被终止后怎么发邮件呢 ??
发表于 2009-7-20 13:42:21 | 显示全部楼层
要进程结束就发个邮件

你究竟是要结束进程就先要发邮件
还是结束进程就发送邮件啊???
发表于 2009-8-30 15:44:47 | 显示全部楼层
呵呵,楼上问的是
发表于 2009-8-30 21:45:13 | 显示全部楼层
看出来楼主的意思了,楼主是想搞个软件检测指定进程,如果该进程结束了就向设定的邮箱发邮件通知。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-22 21:26 , Processed in 0.071961 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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