本文介绍了如何防止任务管理器结束我的申请流程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有一个cafemanager应用服务器和客户端。我想阻止用户从任务管理器结束我的客户端应用程序,因为服务器应用程序在关闭时无法再与工作站通信。像防病毒一样说访问被拒绝了。我不想禁用任务管理器,因为它在游戏崩溃时很有用..I have a cafemanager application server & client. I want to prevent my client application to be ended from task manager by users because the server application can no longer communicate to the workstation when it closes. Like antiviruses did saying access denied. I dont want to disable task manager because it is helpful when games crashes..推荐答案Private Sub Form1_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Select Case e.CloseReason Case CloseReason.ApplicationExitCall MsgBox("'ApplicationExitCall' tries to close application", MsgBoxStyle.Information, "CloseReason") Case CloseReason.FormOwnerClosing MsgBox("'FormOwnerClosing' tries to close application", MsgBoxStyle.Information, "CloseReason") Case CloseReason.MdiFormClosing MsgBox("'MdiFormClosing' tries to close application", MsgBoxStyle.Information, "CloseReason") Case CloseReason.TaskManagerClosing e.Cancel = True MsgBox("'TaskManagerClosing' tries to close application", MsgBoxStyle.Information, "CloseReason") Case CloseReason.UserClosing MsgBox("'UserClosing' tries to close application", MsgBoxStyle.Information, "CloseReason") Case CloseReason.WindowsShutDown MsgBox("'WindowsShutDown' tries to close application", MsgBoxStyle.Information, "CloseReason") Case CloseReason.None MsgBox("'None' tries to close application", MsgBoxStyle.Information, "CloseReason") Case Else MsgBox("'Else' tries to close application", MsgBoxStyle.Information, "CloseReason") End Select End Sub e.Cancel = True您可以避免第一次尝试通过任务管理器或其他CloseReasons中止应用程序/> 希望这可以帮到你。 问候马库斯with e.Cancel = True you can avoid the first try to abort the application by Task Manager or other CloseReasonsHope this can help you.Regards Markus 这篇关于如何防止任务管理器结束我的申请流程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-23 19:52