如何在一个程序中限制另一个程序运行,如限制QQ登入
求相关代码
------解决方案-------------------- C# code
Process[] p = System.Diagnostics.Process.GetProcessesByName("QQ2009");
for (int i = p.Length; i > 0; i--)
{
    p[i].Kill();
}
------解决方案--------------------  探讨 ------解决方案-------------------- ------解决方案-------------------- ------解决方案-------------------- C# code
private void button1_Click(object sender, EventArgs e)  // 可以放到 Form_load中
{
    timer1.Interval = 200;  // 200ms 检测一次
    timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
    Process[] p = System.Diagnostics.Process.GetProcessesByName("QQ");
    for (int i = p.Length - 1; i >= 0; i--)
    {
        p[i].Kill();
    }
}
------解决方案--------------------  探讨 ------解决方案-------------------- 探讨 ------解决方案--------------------