Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Diagnostics;
- using System.Threading;
- using System.IO;
- namespace Game_Lister
- {
- class Program
- {
- static void Main(string[] args)
- {
- while (true)
- {
- Process[] processlist = Process.GetProcesses();
- try
- {
- using (StreamReader read = new StreamReader("process.txt"))
- {
- string process ;
- while ((process = read.ReadLine()) != null)
- {
- Console.WriteLine(process);
- }
- }
- }
- catch (Exception e)
- {
- }
- foreach (Process theprocess in processlist)
- {
- switch (theprocess.ProcessName)
- {
- case process:
- Console.WriteLine("Curse currently running");
- var time = theprocess.StartTime;
- Console.WriteLine(time);
- theprocess.WaitForExit();
- var end = DateTime.Now;
- Console.WriteLine(end);
- var lasting = end - time;
- Console.WriteLine(lasting.Seconds);
- break;
- }
- }
- Thread.Sleep(1000);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment