在启动任务管理器中终止进程 [英] Kill process in start task manager

查看:76
本文介绍了在启动任务管理器中终止进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在设计wpf应用程序...我的问题是在关闭窗口时我想杀死任务管理器中的任务...任何人都可以帮助我。

Hello,
I am designing wpf application... My problem is that on window closing i want to kill the task in the task manager ... Can anyone please help me out.

推荐答案

检查线程..希望你能解决问题。



taskkill-exe-does-not-properly-close-wpf-application [ ^ ]



wpf-application-still-in-background-after-closing [ ^ ]
Check the threads..hope you will be able to solve your problem.

taskkill-exe-does-not-properly-close-wpf-application[^]

wpf-application-still-runs-in-background-after-closing[^]


Ha你试过使用process.Kill()杀死任务管理器中的进程





Have you tried using process.Kill() to kill process in task manager


using System.Diagnostics;
 foreach (Process proc in Process.GetProcessesByName("OUTLOOK"))
            {
                proc.Kill();
            }





希望它可以帮助你。



Hope it helps you.


只需将事件放入xaml代码



Just Place ane event in the xaml code

Closing="Window_Closing"







然后在.cs页面为该结束事件编写一个事件处理程序



代码:






Then write a event handler for that closing event in .cs page

Code:

private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
       {
           Application.Current.Shutdown();

       }


这篇关于在启动任务管理器中终止进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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