المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Is it safe to use Process.GetCurrentProcess().Kill() ?



C# Programming
10-08-2009, 03:40 AM
Hi,
I have developed an application in C# .Net... My requirement is that the application should clean up all the resources that it used and exit when I click on the "Exit" option that I have provided.. But sometimes, when I try to exit the application using "Application.Exit()", the application fails to exit and continues to be listed on the Windows processes in the task manager. I would like to know if I can use Process.GetCurrentProcess().Kill() instead of Application.Exit(). If not, please suggest on what I can do to have the application exit when I want it to...

Thanks,
ramz_g