.NET Console applications
Learn
Libraries
- commandlineparser/commandline: "C# command line parser that brings standardized *nix getopt style, for .NET"
Deployment
Examples
- dotnet/try-convert: "Sample tool showing how to build a global tool and also help you convert projects to .NET Core"
Recipes
Working with processes
- Get the list of active processes
var processes = System.Diagnostics.Process.GetProcesses();
- Start a new process
using System.Diagnostics;
using (var process = new Process()
{
StartInfo = new ProcessStartInfo
{
FileName = "my\path\file.exe",
Arguments = "my arguments",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
Verb = "runas"
}
})
{
process.Start();
var result = process.StandardOutput.ReadToEnd();
process.WaitForExit();
return result;
}