Wpf关闭程序杀死所有线程:
Process.GetCurrentProcess().Kill();
using System.Diagnostics;
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
Process.GetCurrentProcess().Kill();
}
这篇博客介绍了如何在WPF应用中利用Process.GetCurrentProcess().Kill()方法在窗口关闭事件中结束所有线程,实现程序的彻底关闭。
Wpf关闭程序杀死所有线程:
Process.GetCurrentProcess().Kill();
using System.Diagnostics;
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
Process.GetCurrentProcess().Kill();
}

被折叠的 条评论
为什么被折叠?