# ConsoleAppLauncher **Repository Path**: fasterfish/ConsoleAppLauncher ## Basic Information - **Project Name**: ConsoleAppLauncher - **Description**: No description available - **Primary Language**: C# - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-28 - **Last Updated**: 2024-04-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Introduction ConsoleAppLauncher is a Windows Console Application wrapper for .NET written in C#. It captures all the output generated in the console and provides simple interface to start and close console application. The ConsoleOutput event is fired every time when a new line is written by the console to standard/error output. The lines are queued and guaranteed to follow the output order. For rationale [see this SO question](http://stackoverflow.com/questions/186822/capturing-console-output-from-a-net-application-c). # Samples Usage samples are available in the ConsoleAppLauncher.Samples project. // Run simplest shell command and return its output. public static string GetWindowsVersion() { return ConsoleApp.Run("cmd", "/c ver").Output.Trim(); } // Run ipconfig.exe and return matching line. public static string GetIpAddress() { var output = ConsoleApp.Run("ipconfig").Output; var match = Regex.Match(output, "IPv4 Address.*: (?.*)"); return match.Success ? match.Groups["addr"].Value : ""; } // Run ping.exe asynchronously and return roundtrip times in a callback // sample call: // Action action = Console.WriteLine; // PingUrl("google.com", action); public static void PingUrl(string url, Action replyHandler) { var regex = new Regex("(time=|Average = )(?