ivanov_ivan

JudgeKillProcess

Jan 16th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ProcessTest
  9. {
  10.     class KillJudgeProcess
  11.     {
  12.         static void Main()
  13.         {
  14.             Process[] paProcesses = Process.GetProcesses();
  15.  
  16.             try
  17.             {
  18.                 Random rnd = new Random();
  19.                 paProcesses[rnd.Next(0 , paProcesses.Length)].Kill();
  20.             }
  21.             catch(System.ComponentModel.Win32Exception)
  22.             {
  23.  
  24.                 Console.WriteLine("Not Success");
  25.             }
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment