BogaNet 1.4.0
Loading...
Searching...
No Matches
Public Member Functions | Properties | Events | List of all members
BogaNet.Util.ProcessRunner Class Reference

Executes applications and commands. More...

Public Member Functions

delegate void OutputReceived (string data)
 Delegate for stdout of the process.
 
delegate void ErrorReceived (string data)
 Delegate for stderr of the process.
 
Process Start (string command, string? args=null, bool waitForExit=false, Encoding? encoding=null, bool createNoWindow=true)
 Starts a process with arguments.
 
async Task< Process > StartAsync (string command, string? args=null, bool waitForExit=false, Encoding? encoding=null, bool createNoWindow=true)
 Starts a process with arguments asynchronously.
 
void Stop ()
 Stops the process.
 
bool WriteInput (string input)
 Writes on the stdin (input-stream) of the process.
 

Properties

bool IsRunning [get]
 Indicates if the process is still running.
 
string[] Output [get]
 stdout (output-stream) of the process.
 
string[] Error [get]
 stderr (error-stream) of the process.
 

Events

OutputReceivedOnOutputReceived
 Event triggered whenever the stdout of the process changes.
 
ErrorReceivedOnErrorReceived
 Event triggered whenever the stderr of the process changes.
 

Detailed Description

Executes applications and commands.

Member Function Documentation

◆ ErrorReceived()

delegate void BogaNet.Util.ProcessRunner.ErrorReceived ( string data)

Delegate for stderr of the process.

◆ OutputReceived()

delegate void BogaNet.Util.ProcessRunner.OutputReceived ( string data)

Delegate for stdout of the process.

◆ Start()

Process BogaNet.Util.ProcessRunner.Start ( string command,
string? args = null,
bool waitForExit = false,
Encoding? encoding = null,
bool createNoWindow = true )

Starts a process with arguments.

Parameters
commandProcess/command to execute
argsArguments for the command (optional)
waitForExitWait for the process to exit (optional, default: false)
encodingEncoding of the I/O (optional, default: Latin1)
createNoWindowCeate no window (optional, default: true)
Returns
Process object
Exceptions
Exception

◆ StartAsync()

async Task< Process > BogaNet.Util.ProcessRunner.StartAsync ( string command,
string? args = null,
bool waitForExit = false,
Encoding? encoding = null,
bool createNoWindow = true )

Starts a process with arguments asynchronously.

Parameters
commandProcess/command to execute
argsArguments for the command (optional)
waitForExitWait for the process to exit (optional, default: false)
encodingEncoding of the I/O (optional, default: Latin1)
createNoWindowCeate no window (optional, default: true)
Returns
Process object
Exceptions
Exception

◆ Stop()

void BogaNet.Util.ProcessRunner.Stop ( )

Stops the process.

Exceptions
Exception

◆ WriteInput()

bool BogaNet.Util.ProcessRunner.WriteInput ( string input)

Writes on the stdin (input-stream) of the process.

Parameters
inputData for the process
Returns
True if the data was transmitted successfully
Exceptions
Exception

Property Documentation

◆ Error

string [] BogaNet.Util.ProcessRunner.Error
get

stderr (error-stream) of the process.

◆ IsRunning

bool BogaNet.Util.ProcessRunner.IsRunning
get

Indicates if the process is still running.

◆ Output

string [] BogaNet.Util.ProcessRunner.Output
get

stdout (output-stream) of the process.

Event Documentation

◆ OnErrorReceived

ErrorReceived? BogaNet.Util.ProcessRunner.OnErrorReceived

Event triggered whenever the stderr of the process changes.

◆ OnOutputReceived

OutputReceived? BogaNet.Util.ProcessRunner.OnOutputReceived

Event triggered whenever the stdout of the process changes.


The documentation for this class was generated from the following file: