如何使用c#强制关闭Windows应用程序 [英] How to close the windows application forcefully using c#

查看:89
本文介绍了如何使用c#强制关闭Windows应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个问题,问题就像

我已经关闭了作为WPF应用程序的exe。但我仍然可以在任务管理器中看到。

我使用过代码

Hi,

I have an issue, the issue is like
I have closed the exe which is a WPF application. But still I can see in the Task Manager.
I have used the code

Process.GetCurrentProcess().Kill();



仍然在任务管理器中运行。



重要提示:我已经初始化并运行了计时器作业应用程序。在这种情况下,这是一个问题。



问题是我的客户环境中存在的问题,但不在我的客户环境中。所以无法复制和检查。



请帮助我。



谢谢&此致,

Mathi。


still it is running in the task manager.

Important Note: I have timer jobs initialised and running in the application. Will that be an issue in this case.

The probelm is the issue persists in my customer's environment only but not in mine. So couldn't replicate and check.

Please help me in this.

Thanks & Regards,
Mathi.

推荐答案

请参阅此答案 [ ^ ]


是否可以尝试
Please see this answer on SO[^]

Is it possible to try
Application.Exit()





[请鼓励参与投票解决方案或适合您的答案]

instead?

[Please encourage participation by up-voting solutions or answers that work for you]


访问此处以了解更多信息.....

< a href =http://stackoverflow.com/questions/7146080/closing-applications> http://stackoverflow.com/questions/7146080/closing-applications [ ^ ]







如何到正常关闭-a-running-windows-form-process-from-a-service-c [ ^ ]
visit here to understand more.....
http://stackoverflow.com/questions/7146080/closing-applications[^]

or

how-to-properly-close-a-running-windows-form-process-from-a-service-c[^]


这篇关于如何使用c#强制关闭Windows应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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