Send string commands or bytes to a Windows Service? (When running)

后端 未结 4 1286
予麋鹿
予麋鹿 2021-02-10 22:41

Is there any way to give string or byte array commands to a Windows Service? (When running)

4条回答
  •  庸人自扰
    2021-02-10 23:07

    I will sometimes host a WCF service within a Windows service for the purpose of controlling the behavior of the service at runtime.

    If you really just want to send raw data to the service and you don't want to deal with configuring a WCF service (which really isn't that difficult to do, by the way), you could probably accomplish that using Named Pipes or by listening for socket connections on some port.

提交回复
热议问题