Вопрос

I am trying To kill The Process "cheatengine-i386.exe" But I Get Error "Access Denied" .

    private void Form1_Load(object sender, EventArgs e)
    {
        Process[] runningProcesses = Process.GetProcesses();
        foreach (Process process in runningProcesses)
        {
            // now check the modules of the process
            foreach (ProcessModule module in process.Modules)
            {
                if (module.FileName.Equals("cheatengine-i386.exe"))
                {
                    process.Kill();
                }
            }
        }
    }
}

}

Это было полезно?

Решение

Your program where you are trying to kill cheatengine-i386.exe is not running with enough privileges to kill the other process. You probably need to run your program as an administrator.

Другие советы

The program certainly changed its ACL to prevent itself from being killed. Logically speaking, the solution it to change its ACL back, but you can't do that in managed code at all, and dealing with locked-out ACL objects is so painful in native code I let pre-written programs do it for me.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top