且构网

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

如何让服务在当前用户的会话下运行进程?

更新时间:2023-01-28 08:41:39

如果该服务需要以当前用户身份运行,那么为什么要使其成为一项服务?服务的目的是始终运行,即使用户未登录也是如此.因此,该服务旨在始终以特定用户身份运行.

If the service needs to run as the current user, then why make it a service? The purpose of a service is to run at all times, even when a user is not logged in. As such, it's designed to run as a specific user at all times.

为什么不将其转换为用户登录时运行的程序?

Why not convert this to a program that runs when a user logs in?