Exit with the System.Exit.Exit.

xiaoxiao2021-03-06  45

I have a program, only one main interface, press "X" to close the program on the right. The main interface is turned off, but when I update the program, I found that I can't overwrite it. Open the Task Manager and find that its process still exists. After the force is completed, an exit button is added, and use Application.exit () to exit, but there is still no effect. I usually use this method to exit. Checking MSDN This explains all message loops running on all threads and closes all the windows of the application. This method does not force the application to exit .Exit method usually calls from one message cycle, this method is forced RUN Returns. "It turns out that it does not force the program, just close all the windows. But in Checking the exit method, I found that SYSTEM.Environment also has an exit method, which can terminate the program's process. Use system.environment.exit (0); successfully exit. But I still don't know what makes the program not to exit with Application.exit ().

转载请注明原文地址:https://www.9cbs.com/read-79883.html

New Post(0)