C#退出程序,退出任务管理器

//窗体关闭之前
this.FormClosing += (s, r) =>
{
    System.Environment.Exit(0);
};
//窗体关闭
this.Closed += (s, r) =>
{
    this.Dispose();
    this.Close();
};

猜你喜欢

转载自www.cnblogs.com/sntetwt/p/9783546.html