且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows上的普通用户可以启动服务吗?

更新时间:2023-01-14 22:45:37

默认情况下,您需要具有管理员权限才能启动,停止,安装和删除服务。

By default you need to have admin privileges to start, stop, install and delete services.

您将必须安排服务公开其自己的Active属性,这与Windows所运行的术语有所不同。安排它始终以Windows术语运行,但是当其Active属性为false时保持惰性。

You will have to arrange for your service to expose its own Active property, distinct from what Windows terms as running. Arrange that it is running in Windows terms all the time, but inert when its Active property is false.

您必须为用户应用实现一种控制机制。我已经使用命名管道完成了此操作,但是还有其他可用的IPC方法。

You'll have to implement a control mechanism for your user app. I've done this with named pipes but the are other IPC methods available.