Table of Contents

Class ProcessLauncherExtensions

Namespace
NanoByte.Common.Native
Assembly
NanoByte.Common.dll

Extension methods for IProcessLauncher.

public static class ProcessLauncherExtensions
Inheritance
object
ProcessLauncherExtensions

Methods

RunAndCapture(IProcessLauncher, ArraySegment<byte>, params string[])

Runs the sub process, captures its stdout and stderr output and waits for it to exit.

public static string RunAndCapture(this IProcessLauncher processLauncher, ArraySegment<byte> stdinData, params string[] arguments)

Parameters

processLauncher IProcessLauncher

The sub process.

stdinData ArraySegment<byte>

Data to the process' stdin right after startup.

arguments string[]

Command-line arguments to launch the process with.

Returns

string

The process' complete stdout output.

Exceptions

IOException

There was a problem launching the executable.

FileNotFoundException

The executable file could not be found.

NotAdminException

The target process requires elevation.

ExitCodeException

The process exited with a non-zero System.Diagnostics.Process.ExitCode.

RunAndCapture(IProcessLauncher, params string[])

Runs the sub process, captures its stdout and stderr output and waits for it to exit.

public static string RunAndCapture(this IProcessLauncher processLauncher, params string[] arguments)

Parameters

processLauncher IProcessLauncher

The sub process.

arguments string[]

Command-line arguments to launch the process with.

Returns

string

The process' complete stdout output.

Exceptions

IOException

There was a problem launching the executable.

FileNotFoundException

The executable file could not be found.

NotAdminException

The target process requires elevation.

ExitCodeException

The process exited with a non-zero System.Diagnostics.Process.ExitCode.