[C#] - Protect Your Program From Task Manager

This disables the default windows task manager on a separate thread so it doesn't interfere with the rest of the program.

Uses a timer to constantly check for task manager and closes each found occurence.



//indent
private Thread taskmgrKill;

private void test()
{
Process[] taskMgr = Process.GetProcessesByName("taskmgr");
foreach (Process p in taskMgr)
p.Kill();
}

private void tmr(object sender, EventArgs e)
{
taskmgrKill = new Thread(new ThreadStart(test));
taskmgrKill.Start();
}

0 comments:

Post a Comment