Displaying posts categorized under

Services

Creating a Windows service in C#

 
Our goals:

Create a service, which will be installed in Service Manager as any service
It should however (pretty much like the MySQL service) be able to run it fromcommandline (use a -cl switch). So, in Visual Studio, we should be able to run it in debug mode just like any command line program
And, oh, lets put [...]

Process.Start and redirect standard output

This snippet will show you how to start a command line program – and redirect the output from it to a System.IO.StreamReader. You can then easily read all the output generated from the external program and analyze it or do whatever you please with it:
The example below calls the mysqldump program (for MySQL backup)  which normally dumps the [...]