Quote:
Originally posted by Redth
well, I'm going to suggest an alternative to Edneeis's method (which is probably a lot more proper than mine, but i gotta do it just to bug Edneeis and resist Remoting ;) )..
anyways... You may see under the evnets you can handle in your windows service one called "OnCustomCommand(command As Integer)" ... from the ServiceControllerClass, you can call the OnCustomCommand and send any integer you want to the windows service this way..
as you can imagine, this is a bit limiting since it only allows you to pass integers.... But you could easily do something like put a string at a specific location in the registry and then call the OnCustomCommand and then retrieve that registry value in the windows service...
This method of course is a bit hack, but would work nicely if you need very simple communication...
To expand on this idea, if your service has a fixed set of parameters then you could just pass in a bit-wise value and determine the number of parameters to enable/disable, based on that value.