Executes applications and commands.
More...
|
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.
|
|
|
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.
|
|
Executes applications and commands.
◆ 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
-
command | Process/command to execute |
args | Arguments for the command (optional) |
waitForExit | Wait for the process to exit (optional, default: false) |
encoding | Encoding of the I/O (optional, default: Latin1) |
createNoWindow | Ceate no window (optional, default: true) |
- Returns
- Process object
- Exceptions
-
◆ 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
-
command | Process/command to execute |
args | Arguments for the command (optional) |
waitForExit | Wait for the process to exit (optional, default: false) |
encoding | Encoding of the I/O (optional, default: Latin1) |
createNoWindow | Ceate no window (optional, default: true) |
- Returns
- Process object
- Exceptions
-
◆ Stop()
void BogaNet.Util.ProcessRunner.Stop |
( |
| ) |
|
Stops the process.
- Exceptions
-
◆ WriteInput()
bool BogaNet.Util.ProcessRunner.WriteInput |
( |
string | input | ) |
|
Writes on the stdin (input-stream) of the process.
- Parameters
-
input | Data for the process |
- Returns
- True if the data was transmitted successfully
- Exceptions
-
◆ 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.
◆ OnErrorReceived
Event triggered whenever the stderr of the process changes.
◆ OnOutputReceived
Event triggered whenever the stdout of the process changes.
The documentation for this class was generated from the following file:
- /Users/stefanlaubenberger/Projects/CSharp/BogaNet/BogaNet.Common/Util/ProcessRunner.cs