Guest User

Untitled

a guest
Mar 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3.  
  4. namespace ConsolePauser
  5. {
  6. internal class Program
  7. {
  8. private static void Main(string[] args)
  9. {
  10. if (args.Length == 0)
  11. {
  12. Console.Write("Console Pauser for Brainfuck Builder 2. Copyright (C) by Krzysztof Szewczyk.");
  13. Console.WriteLine("Too small amount of arguments.");
  14. Console.ForegroundColor = ConsoleColor.DarkCyan;
  15. Console.BackgroundColor = ConsoleColor.Black;
  16. Console.WriteLine("\n\n----------------------------------------------");
  17. Console.WriteLine("Press any key to continue ... ");
  18. Console.ReadKey();
  19. }
  20. else
  21. {
  22. try
  23. {
  24. using (Process process = Process.Start(new ProcessStartInfo()
  25. {
  26. UseShellExecute = false,
  27. FileName = args[0]
  28. }))
  29. {
  30. process.WaitForExit();
  31. TimeSpan timeSpan = process.ExitTime - process.StartTime;
  32. int exitCode = process.ExitCode;
  33. Console.ForegroundColor = ConsoleColor.DarkCyan;
  34. Console.BackgroundColor = ConsoleColor.Black;
  35. Console.WriteLine("\n\n----------------------------------------------");
  36. Console.WriteLine("Process exited with code " + (object) exitCode + " in " + (object) timeSpan + "s");
  37. Console.WriteLine("Press any key to continue ... ");
  38. Console.ReadKey();
  39. }
  40. }
  41. catch (Exception ex)
  42. {
  43. }
  44. }
  45. }
  46. }
  47. }
Add Comment
Please, Sign In to add comment