防止WPF应用程序从任务管理器中被杀死

编程入门 行业动态 更新时间:2024-10-10 01:26:40
本文介绍了防止WPF应用程序从任务管理器中被杀死的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何防止我的WPF应用程序被任务管理器杀死? 请帮帮我... 预先感谢U.

How can i prevent my WPF application from getting killed from task manager ? Please help me out... Thank U in advance.

推荐答案

没有办法.但是您可以将您的应用程序附加到另一个进程.为此,您必须将应用程序类型更改为类库,并将其添加到rundll.exe或其他进程(例如explorer.exe,winlogon.exe). 要了解更多信息,请访问 stackoverflow/questions/187983/how-do-i-hide-a-process-in-task-manager-in-c [ ^ ] bytes/topic/c-sharp/answers/825121-how-can-i-prevent-application-being-end-task-manager-howto-keep-always-alive [ ^ ] There is no way to do that. But you can attach your application to another process. TO do this you have to change your application type to class library and add this into rundll.exe or any other process like explorer.exe, winlogon.exe. To know more about it go stackoverflow/questions/187983/how-do-i-hide-a-process-in-task-manager-in-c[^] bytes/topic/c-sharp/answers/825121-how-can-i-prevent-application-being-ended-task-manager-howto-keep-always-alive[^]

您不能.任务管理器可以看到所有内容,并且任务管理器可以杀死所有内容-在所有访问级别. 您可以隐藏您的进程,但这可能需要您编写一个内核模式驱动程序来拦截对NtQuerySystemInformation的调用,以使SystemProcessInformation类无法列出您的进程. 不太可能获得在公司服务器上安装类似内容的权限,并且UAC会阻止它在台式机上发生. You can''t. Task Manager sees all, and Task Manager can kill all - at ALL access levels. You could hide your process, but that would probably require you to to write a kernel-mode driver to intercept calls to NtQuerySystemInformation so that the SystemProcessInformation class can''t list your process. Getting permission to install something like that on a corporate server would be unlikely, and the UAC prevents it from happening on desktop machines.

确保用户不是任何类型的管理员-管理员显然需要能够终止他们想要的任何进程. 提供从登录会话到具有所需特权的用户的访问权限,以在登录会话中启动该过程.您可以通过服务来做到这一点.这是有关 Window Station安全和访问权限 [ ^ ] 拒绝登录用户的过程的PROCESS_TERMINATE权限. 有关进程安全性和访问权限的更多信息,请此处 [ ^ ]. 所以基本上可以做到...但是这并不完全是微不足道的:) [更新] Csrss.exe是Win32子系统的用户模式部分; Win32.sys是内核模式部分. Csrss代表客户端/服务器运行时子系统",并且是必须始终运行的必不可少的子系统. Csrss负责控制台窗口,创建和/或删除线程以及实现16位虚拟MS-DOS环境的某些部分. Smss.exe是会话管理器子系统,它负责启动用户会话.此过程由主系统线程启动,并负责各种活动,包括启动Winlogon和Win32(Csrss.exe)进程以及设置系统变量.启动这些过程后,它将等待Winlogon或Csrss结束.如果正常,系统将关闭;否则,系统将关闭.如果发生意外,Smss.exe会导致系统停止响应 所以阻止它们不是一个好主意 最好的问候 Espen Harlinn Make sure that the user is not any kind of administrator - administrators obviously needs to be able to kill any process they want. Provide access from the logon session to a user with required priviledges to start the process in the logon session. That''s something you can do from a service. Here is some info on Window Station Security and Access Rights[^] Deny the logged on user the PROCESS_TERMINATE permission for the process. More on process security and access rights here[^]. So basically it can be done ... but it''s not entirely trivial :) [Update] Csrss.exe is the user-mode portion of the Win32 subsystem; Win32.sys is the kernel-mode portion. Csrss stands for Client/Server Run-Time Subsystem, and is an essential subsystem that must be running at all times. Csrss is responsible for console windows, creating and/or deleting threads, and implementing some portions of the 16-bit virtual MS-DOS environment. Smss.exe is the session manager subsystem, which is responsible for starting the user session. This process is initiated by the main system thread and is responsible for various activities, including launching the Winlogon and Win32 (Csrss.exe) processes, and setting system variables. After it has launched these processes, it waits for either Winlogon or Csrss to end. If this happens normally, the system shuts down; if it happens unexpectedly, Smss.exe causes the system to stop responding So stopping them is not a good idea Best regards Espen Harlinn

更多推荐

防止WPF应用程序从任务管理器中被杀死

本文发布于:2023-11-27 11:15:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1637841.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:被杀   应用程序   任务管理器   WPF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!