简体   繁体   English

如何使用C#和Windows服务创建无敌Windows应用程序

[英]How to create invincible windows application using c# and windows services

I wrote a windows form application running in my local system. 我编写了一个在本地系统中运行的Windows窗体应用程序。 I wanna make it invictible. 我想让它无懈可击。 I mean, I want to the users cannot kill the process using task manager or any other third party application. 我的意思是,我希望用户不能使用任务管理器或任何其他第三方应用程序终止该进程。 So I wrote a windows service to run this application on startup. 所以我写了一个Windows服务来在启动时运行该应用程序。 I thought I need to run windows service as SYSTEM but how can I do that ? 我以为我需要将Windows服务作为SYSTEM运行,但是我该怎么做呢?

Is there any spesific suggestion for this kind a situation ? 对于这种情况有什么特别的建议吗?

I also had the same problem with an application at work, which the users shouldn't be able to close. 我在工作的应用程序也遇到了同样的问题,用户应该无法关闭它。

You have to allow the servie Allow service to interact with desktop . 您必须允许servie Allow服务与桌面交互 Heres an example how to do this while installing the service: http://www.codeproject.com/KB/install/cswindowsservicedesktop.aspx 以下是安装服务时如何执行此操作的示例: http : //www.codeproject.com/KB/install/cswindowsservicedesktop.aspx

Now you are able the launch a GUI application from the service, for the current logged in user. 现在,您可以从服务中为当前登录用户启动GUI应用程序。 You should look in a intervall if the process for the current user is still running, if not just start it again. 如果当前用户的进程仍在运行,则应该查看一下intervall,如果不只是重新启动它的话。

See here for current user processes: http://www.codeproject.com/KB/cs/processownersid.aspx 有关当前用户流程,请参见此处: http : //www.codeproject.com/KB/cs/processownersid.aspx

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

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