0 Votes" 0
karenpayneoregon answered • 2 days ago Best AnswerACCEPTED ANSWER
Look at ServiceBase.OnCustomCommand(Int32) Method

Create a ServiceController

ServiceController Controller = new ServiceController("MyWindowsService");

Validate the status is running e.g. Controller.Status == ServiceControllerStatus.Running and if running pass an int to work with OnCustomCommand


1 Vote" 1
Bruce-SqlWork answered • 2 days ago Expert AnswerCommunity Expert
The service has to listen for requests. You need to decide how this is done. In the early days you used nt rpc calls, and still can. But adding a rest api or gRPC to the service is more modern.

This is easy to do with .net core or net 6. You WPF would just use WebClient to call the service.

Created: 06/12/2021 16:25:06
Page views: 143