C# 一个小程序,每隔一秒检测QQ.EXE进程是否存在,怎么写

如题

所需控件:Label、Timer。控件属性设置:label : ID ——lblisExist Timer : ID ——timer1 Enable——true Interval——1000 // 因为单位是毫秒 So 1000=1秒双击timer1 ,编写Code: private void timer1_Tick(object sender, EventArgs e)
{
string processname = "QQ";
if (Process.GetProcessesByName(processname).Length > 0)
{
lblisExist.Text = "存在";
}
else
{
lblisExist.Text = "不存在";
}
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-01-04
用个timer控件,通过System.Diagnostics.Process.GetProcesses得到当前所有进程,然后再一个一个去进程名称是不是QQ.EXE
相似回答