将字符串命令或字节发送到 Windows 服务?(跑步时) [英] Send string commands or bytes to a Windows Service? (When running)

查看:31
本文介绍了将字符串命令或字节发送到 Windows 服务?(跑步时)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法向 Windows 服务提供字符串或字节数组命令?(运行时)

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

推荐答案

我有时会在 Windows 服务中托管 WCF 服务,以便在运行时控制服务的行为.

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

如果您真的只想将原始数据发送到服务并且不想处理配置 WCF 服务(顺便说一句,这确实不难做到),您可能可以使用命名管道或通过侦听某个端口上的套接字连接.

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.

这篇关于将字符串命令或字节发送到 Windows 服务?(跑步时)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆