As we all know, process can start and shut down the processes on the computer, the namespace is located in System.Diagnostics, this tutorial is the use of the GetProcesses and kill method to achieve.
One, coding work
First we create a console project (as long as C # is possible)
To keep this blog short, I've streamlined the code
Next we need to use foreach to cycle through the processes in the computer.
foreach (var in Process.getprocesses ())
To avoid killing yourself halfway, you need to skip yourself and use its ProcessName property (Systemkill can change it yourself)
if " Systemkill ")
Some processes do not kill, so you need to put a try catch on him before using the Kill method, like this
foreach (var in process.getprocesses ()) { try{ if" Systemkill " ) P.kill (); } Catch { } }
This will show a small box where we can change the project type to the Windows window app
There are still some stubborn system processes that cannot be killed, and this requires the highest level of authority (highestavailable)
Change the requestedExecutionLevel entry under the App.manifest file
If this file is not available in the project properties > Security > Enable ClickOnce, wait for the file to appear before you close ClickOnce.
Second, the compilation test
Video: Https://gitee.com/TwilightLemon/Updata/raw/master/cc.mp4
Distressed Computer 1 ms
Finally, attach source code a Https://github.com/TwilightLemon/SystemKill
I hope you have a lot of attention to me Oh!
"HK" Daily use C # process to write a small virus