Is there any way to give string or byte array commands to a Windows Service? (When running)
You can send start, restart and stop commands to the service, and I belive you can execute other defined commands as well.
Here is an example of programatically starting a registered service called "myService"
using System.ServiceProcess;
//...
System.ServiceProcess.ServiceController Service;
Service = new ServiceController("myService");
if (Service != null && Service.Status == ServiceControllerStatus.Stopped)
Service.Start();
//...
Look in SeviceController. You are probably looking for:
// // Summary: // Executes a custom command on the service. // public void ExecuteCommand(int command);
It's my understanding though that these commands need to be predefined. You cannot pass arbrary commands to the services, i.e., this is not a method of passing data.