Show / Hide Table of Contents

Class ProcessRunner

This class is used to run a process and capture the output. It is a wrapper around the System.Diagnostics.Process class.

Inheritance
object
ProcessRunner
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Benday.Common
Assembly: Benday.Common.dll
Syntax
public class ProcessRunner

Constructors

| Edit this page View Source

ProcessRunner(ProcessStartInfo)

Declaration
public ProcessRunner(ProcessStartInfo startInfo)
Parameters
Type Name Description
ProcessStartInfo startInfo

Properties

| Edit this page View Source

ErrorText

The error text from the process. This is the standard error from the process.

Declaration
public string ErrorText { get; }
Property Value
Type Description
string
| Edit this page View Source

HasCompleted

Indicates if the process has completed. This is true if the process has completed with an error or successfully.

Declaration
public bool HasCompleted { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsError

Indicates if the process completed with an error.

Declaration
public bool IsError { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsSuccess

Indicates if the process completed successfully.

Declaration
public bool IsSuccess { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsTimeout

Indicates if the process timed out.

Declaration
public bool IsTimeout { get; }
Property Value
Type Description
bool
| Edit this page View Source

OutputText

The output text from the process. This is the standard output from the process.

Declaration
public string OutputText { get; }
Property Value
Type Description
string
| Edit this page View Source

StartInfo

The ProcessStartInfo object that is used to start the process. This object is used to configure the process start info before running.

Declaration
public ProcessStartInfo StartInfo { get; }
Property Value
Type Description
ProcessStartInfo
| Edit this page View Source

Timeout

The timeout in milliseconds for the process to run. The default timeout is 10 seconds.

Declaration
public int Timeout { get; set; }
Property Value
Type Description
int

Methods

| Edit this page View Source

Run()

Run the command

Declaration
public void Run()
Exceptions
Type Condition
InvalidOperationException
TimeoutException
  • Edit this page
  • View Source
In this article
Back to top Copyright © www.benday.com | info@benday.com