简体   繁体   English

c#从Windows Service启动应用程序的最佳方法

[英]c# Best way to start application from Windows Service

I have Windows service started from Local Service. 我有从本地服务启动的Windows服务。 This service can be installed on terminal windows server with multiple users. 可以在具有多个用户的终端Windows服务器上安装此服务。 As I understand service started in "Session 0" and can not interact with users in easy way. 据我了解,服务始于“会话0”,无法以简单的方式与用户进行交互。 What is the best way start another exe file for each user from this service? 从此服务为每个用户启动另一个exe文件的最佳方法是什么? I think this another application can not be started from service directly. 我认为这另一个应用程序不能直接从服务启动。 I can add via service add application in registry startup key and this application will start on next logon, but I not sure that it is the best solution 我可以通过服务添加应用程序在注册表启动项中添加,并且此应用程序将在下次登录时启动,但是我不确定这是最佳解决方案

You have to create a separate app with a GUI and way of communication between them. 您必须使用GUI和它们之间的通信方式来创建一个单独的应用程序。 There are many ways for this and each of them has benefits and drawbacks. 有很多方法可以实现,每种方法都有其优点和缺点。 So it depends stronly on your needs. 因此,它完全取决于您的需求。

Just to mention a few: 仅举几例:

  • Sockets 套接字

  • Named Pipes 命名管道

... ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM