Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Diagnostics;
- namespace ConsolePauser
- {
- internal class Program
- {
- private static void Main(string[] args)
- {
- if (args.Length == 0)
- {
- Console.Write("Console Pauser for Brainfuck Builder 2. Copyright (C) by Krzysztof Szewczyk.");
- Console.WriteLine("Too small amount of arguments.");
- Console.ForegroundColor = ConsoleColor.DarkCyan;
- Console.BackgroundColor = ConsoleColor.Black;
- Console.WriteLine("\n\n----------------------------------------------");
- Console.WriteLine("Press any key to continue ... ");
- Console.ReadKey();
- }
- else
- {
- try
- {
- using (Process process = Process.Start(new ProcessStartInfo()
- {
- UseShellExecute = false,
- FileName = args[0]
- }))
- {
- process.WaitForExit();
- TimeSpan timeSpan = process.ExitTime - process.StartTime;
- int exitCode = process.ExitCode;
- Console.ForegroundColor = ConsoleColor.DarkCyan;
- Console.BackgroundColor = ConsoleColor.Black;
- Console.WriteLine("\n\n----------------------------------------------");
- Console.WriteLine("Process exited with code " + (object) exitCode + " in " + (object) timeSpan + "s");
- Console.WriteLine("Press any key to continue ... ");
- Console.ReadKey();
- }
- }
- catch (Exception ex)
- {
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment