Guest User

Untitled

a guest
Jun 22nd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Diagnostics;
  6. using System.Threading;
  7. using System.IO;
  8.  
  9.  
  10. namespace Game_Lister
  11. {
  12. class Program
  13. {
  14. static void Main(string[] args)
  15. {
  16.  
  17. while (true)
  18.  
  19. {
  20.  
  21.  
  22. Process[] processlist = Process.GetProcesses();
  23.  
  24. try
  25. {
  26.  
  27. using (StreamReader read = new StreamReader("process.txt"))
  28. {
  29. string process ;
  30.  
  31. while ((process = read.ReadLine()) != null)
  32. {
  33.  
  34. Console.WriteLine(process);
  35. }
  36. }
  37. }
  38. catch (Exception e)
  39. {
  40.  
  41. }
  42.  
  43.  
  44.  
  45.  
  46. foreach (Process theprocess in processlist)
  47. {
  48.  
  49.  
  50. switch (theprocess.ProcessName)
  51. {
  52. case process:
  53. Console.WriteLine("Curse currently running");
  54. var time = theprocess.StartTime;
  55. Console.WriteLine(time);
  56. theprocess.WaitForExit();
  57. var end = DateTime.Now;
  58. Console.WriteLine(end);
  59. var lasting = end - time;
  60.  
  61. Console.WriteLine(lasting.Seconds);
  62. break;
  63.  
  64. }
  65.  
  66. }
  67. Thread.Sleep(1000);
  68. }
  69.  
  70.  
  71. }
  72.  
  73. }
  74.  
  75. }
Add Comment
Please, Sign In to add comment