简体   繁体   English

关闭Windows XP后,C#应用程序继续运行

[英]C# application keep running after closing windows XP

when I close the application from task management. 当我从任务管理中关闭应用程序时。 I have discovered that he keeps running in windows xp for a few minutes. 我发现他在Windows XP中保持运行了几分钟。 I have already Search the forum but found nothing that comes close to it. 我已经搜索了该论坛,但没有找到任何与之接近的内容。

I use .net 2.0 because it is often already older systems. 我使用.net 2.0,因为它通常已经是较旧的系统。

I hope you are able to help me. 我希望你能帮助我。

I use also a Form_closing void : 我也使用Form_closing void:

 private void Main_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == System.Windows.Forms.CloseReason.TaskManagerClosing || e.CloseReason == CloseReason.WindowsShutDown) { Process.GetCurrentProcess().Kill(); } else { DialogResult result = new DialogResult(); result = MessageBox.Show("Weet je zeker dat je de interface wil sluiten? Hiermee word de automatische werkening gestopt!!", "Afsluiten", MessageBoxButtons.YesNo, MessageBoxIcon.Stop); if (result == DialogResult.No) { e.Cancel = true; } else e.Cancel = false; } } 

System.Windows.Application.Current.Shutdown();

我在保持打开状态的连接中发现了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM