Home > Net >  C # how to ensure that your process can't be closed the task manager
C # how to ensure that your process can't be closed the task manager

Time:11-07

C # to ensure their own process can't be closed the task manager, or prompted for a password to shut down? Online didn't find similar methods, are c + +, look not to understand,
Please give a suggestion, is based on c #, thank you

CodePudding user response:

and this operation? C # can't do it, you can get a timer every few milliseconds query process, if there is Taskmgr. Exe, he shut the

CodePudding user response:

Call ask red leader, how did he do his 360,

CodePudding user response:

I want to do a

Ensure that you can turn off any of the specified process tool,

CodePudding user response:

The need to make system driver service in the form of, also is the kernel level process, the task manager can not kill off,

CodePudding user response:

A service task manager is in the mind of tube

CodePudding user response:

Two processes, mutual care
Using some techniques, such as API hook hidden process, or the process itself into other processes to achieve the purpose of hiding

CodePudding user response:

No direction, online to find the code to try great role,

CodePudding user response:

Internet is becoming more and more difficult to find something

CodePudding user response:

Baidu c # process protection, a lot of
https://blog.csdn.net/zb872676223/article/details/17550577
, etc.

CodePudding user response:

Ha ha, 360 can do not turn off the task manager? The console directly kill 360.

CodePudding user response:

Just "know how to do" (for example daemon service), but need not too entanglements "guarantee cannot be closed the task manager" this kind of words, if you must, then consider how to ensure the computer power will not be pulled out,

CodePudding user response:

references 9 f desperaso response:
baidu c # process protection, a lot of
https://blog.csdn.net/zb872676223/article/details/17550577
And so on


You have to this example is a failure in the 64 - bit systems, field tested, thank you

CodePudding user response:

reference 11 floor interacting in a professional developer response:
just "know how to do" (for example daemon service), but need not too entanglements "guarantee cannot be closed the task manager" this kind of words, if you must, then consider how to ensure the computer power will not be pulled out,


Love to every time your reply, thank you,
Why have this idea, some systems have recently installed kaspersky, exit the software needs to provide a password, the end of the process is prohibited, so need to uninstall software code, the function is good, want to apply to some of the software in the company, so to ask the question,

Online query, no find the right solution for c #

CodePudding user response:

Only find this, set up the process for system state seriously,
To do the program as administrator is to modify the app. As in manifest
Otherwise will go wrong,

 
Public static class ProcessProtection
{
[DllImport (" NTDLL. DLL, "SetLastError=true)]
Private static extern void RtlSetProcessIsCritical (UInt32 UInt32 UInt32 v1, v2, v3);

Private static volatile bool s_isProtected=false;

Private static ReaderWriterLockSlim s_isProtectedLock=new ReaderWriterLockSlim ();

Public static bool IsProtected
{
The get
{
Try
{
S_isProtectedLock. EnterReadLock ();

Return s_isProtected;
}
The finally
{
S_isProtectedLock. ExitReadLock ();
}
}
}

Public static void Protect ()
{
Try
{
S_isProtectedLock. EnterWriteLock ();

if (! S_isProtected)
{
System. Diagnostics. Process. EnterDebugMode ();
RtlSetProcessIsCritical (1, 0, 0);
S_isProtected=true;
}
}
The finally
{
S_isProtectedLock. ExitWriteLock ();
}
}

Public static void Unprotect ()
{
Try
{
S_isProtectedLock. EnterWriteLock ();

If (s_isProtected)
{
RtlSetProcessIsCritical (0, 0, 0);
S_isProtected=false;
}
}
The finally
{
S_isProtectedLock. ExitWriteLock ();
}
}
}

Shut down when they ask, must force blue screen directly, can find RtlSetProcessIsCritical,

CodePudding user response:

Windows service is the standard application form, is not the same as ordinary console procedures, vc can be used to create a standard Windows service program, and then compiled, using the console command to install sc, including set up the service properties (such as failure after the restart, and so on properties),

You can develop a Windows service application, it reads the configuration file information, is responsible for monitoring and pull up all kinds of process, because this service is very simple, but a few lines of code, can be tortured over never goes down,

CodePudding user response:

Vc can be used to create a standard Windows service program - & gt; Vs can be used to create a standard Windows service program

Vs created Windows service process it's just one more service configuration file, you can use it the project properties to manually changed to "console" process, this compiled. Exe file can be either a separate manual start, but can be by sc order for the installation of Windows services, can be deployed in the desktop can also be deployed on the server,

CodePudding user response:

CloseReason. TaskManagerClosing

CodePudding user response:

Write a service, regular testing process, found that didn't own the process starts,
  •  Tags:  
  • C#
  • Related