从Windows服务或WCF服务调用客户端应用程序

从Windows服务或WCF服务调用客户端应用程序

问题描述:

你好,



运行时我有Client Application,它显示在windows的系统托盘中。我有WCF服务与此客户端应用程序进行交互。此WCF服务托管在Windows服务中。



现在,我想在Windows服务启动时运行我的客户端应用程序?这可能吗?



因此,当Windows服务启动时,我的客户端应用程序在Windows中的系统托盘中运行,当它停止时,可以删除客户端应用程序。 />


理想的例子是我们将在系统启动时在系统托盘中看到的防病毒图标。



任何建议,例子将非常感谢。



谢谢!

Hello,

I have Client Application when it runs, it shows in system tray of windows. I have WCF service to interact with this client application. This WCF service hosted in Windows service.

Now, I want to run my client application whenever Windows service starts? Is this possible?

So, when windows service started, my client application runs in system tray in windows, and when it stops, client application can be removed.

The ideal example would be antivirus icon we will see in system tray whenever system is up.

Any suggestion, examples would be highly appreciated.

Thank you !

服务通常在启动Windows。并且用户在那个时间点登录并不是必需的。

因此,您应该使用用户登录启动客户端应用程序。即在程序菜单的StartUp文件夹中添加指向应用程序的链接。

应用程序可以通过System.Diagnostics.Process.GetProcessesByName查询服务是否正在运行,或者查询Servcie Controller。如果您的服务没有运行,它可以自行停止。请注意,以后启动服务时无法启动它。
The service is generally started during the startup of Windows. And it is not at all necessary that a user is logged in at that point of time.
Consequently, you ought to start your client application with the user-login. I.e. you add a link to your application in the StartUp folder of the Program Menu.
The application can find out if the service is running by either System.Diagnostics.Process.GetProcessesByName or queryingthe Servcie Controller. If your service does not run, it can stop itself. Note that it cannot be started when you start your service later on.


我没有找到我要查找的示例。如果你能给我一些链接,我们将不胜感激。
I did not find example I am looking for. If you can provide me some links, would be appreciate.