如何使用c#programe来防止其他进程因关闭按钮而关闭 [英] how to use c# programe to prevent the other process closed by it's close button

查看:122
本文介绍了如何使用c#programe来防止其他进程因关闭按钮而关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#programe来防止其他进程被关闭按钮关闭或被任务管理器关闭?

i搜索了一些关于hook的信息,但不知道它是否能达到我的需要。

任何人都可以给我演示吗?

谢谢!

how to use c# programe to prevent the other process closed by it's close button or closed by Task Manager?
i searched some information about hook,but don't know whether it can reach my need.
can anybody give me demo?
thanks!

推荐答案

您可以使用挂钩来阻止关闭程序。我曾经在VB6中做过这件事。如果你在.NET中没有得到任何建议,我明天会为你准备一个样本。



但是你不能阻止一个进程被关闭由任务管理器或Windows关闭。如果可以,您可以完全阻止窗户正常工作,没有人对此感兴趣。当你被无法关闭他们的操作系统的愤怒用户攻击时甚至不是你。
You can prevent the closing of a program using hooking. I used to do that back in VB6. If you don't get any suggestions in .NET, I'll try to work out a sample for you tomorrow.

But you cannot prevent a process from being closed by the task manager or Windows shutdown. If you could, it would be possible for you to completely prevent windows from working properly, and nobody is interested in that. Not even you when you're attacked by angry users who cannot close their OS.


希望这会有所帮助。



http://csharptest.net/1043/how-to-prevent-users -from-killing-your-service-process / [ ^ ]
Hope this helps.

http://csharptest.net/1043/how-to-prevent-users-from-killing-your-service-process/[^]


这篇关于如何使用c#programe来防止其他进程因关闭按钮而关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆