Guest User

Untitled

a guest
May 25th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. using System.Diagnostics;
  2. using System.Timers;
  3.  
  4. namespace ConsoleApp1
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. Timer t = new Timer(10000);
  11. t.AutoReset = true;
  12. t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed);
  13. t.Start();
  14. }
  15.  
  16. private static void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
  17. {
  18. Process[] overwatch = Process.GetProcessesByName("Overwatch");
  19. Process[] kopanie = Process.GetProcessesByName("Kopanie");
  20. if (overwatch.Length == 0 && kopanie.Length == 0)
  21. Process.Start("Kopanie.exe");
  22. else if (overwatch.Length != 0 && kopanie.Length != 0)
  23. Process.Kill("Kopanie.exe");
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment