Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Diagnostics;
- using System.Timers;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Timer t = new Timer(10000);
- t.AutoReset = true;
- t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed);
- t.Start();
- }
- private static void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
- {
- Process[] overwatch = Process.GetProcessesByName("Overwatch");
- Process[] kopanie = Process.GetProcessesByName("Kopanie");
- if (overwatch.Length == 0 && kopanie.Length == 0)
- Process.Start("Kopanie.exe");
- else if (overwatch.Length != 0 && kopanie.Length != 0)
- Process.Kill("Kopanie.exe");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment