Show / Hide Table of Contents

Class ProcessLauncherExtensions

Extension methods for IProcessLauncher.

Inheritance
Object
ProcessLauncherExtensions
Namespace: NanoByte.Common.Native
Assembly: NanoByte.Common.dll
Syntax
public static class ProcessLauncherExtensions : Object

Methods

RunAndCapture(IProcessLauncher, ArraySegment<Byte>, String[])

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

Declaration
public static string RunAndCapture(this IProcessLauncher processLauncher, ArraySegment<byte> stdinData, params string[] arguments)
Parameters
Type Name Description
IProcessLauncher processLauncher

The sub process.

ArraySegment<Byte> stdinData

Data to the process' stdin right after startup.

String[] arguments

Command-line arguments to launch the process with.

Returns
Type Description
String

The process' complete stdout output.

Exceptions
Type Condition
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 ExitCode.

RunAndCapture(IProcessLauncher, String[])

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

Declaration
public static string RunAndCapture(this IProcessLauncher processLauncher, params string[] arguments)
Parameters
Type Name Description
IProcessLauncher processLauncher

The sub process.

String[] arguments

Command-line arguments to launch the process with.

Returns
Type Description
String

The process' complete stdout output.

Exceptions
Type Condition
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 ExitCode.

In This Article
Back to top Copyright Bastian Eicher