Application.ExitThread,Application.Exit的区别
作者:C/S框架网|www.cscode.ne  发布日期:2020/05/02 22:01:49
  Application.ExitThread,Application.Exit的区别

Application.ExitThread,Application.Exit的区别


Application.Exit方法:


通知所有消息泵必须终止,处理完所有窗口消息,并关闭应用程序所有窗体后关闭程序。

Informs all message pumps that they must terminate, and then closes all application
windows after the messages have been processed.


调用Application.Exit方法,系统会通知当前程序所有已打开的页面,以及处理Form.Closing事件,该方法受CancelEventArgs参数影响,若Cancel=True,Application.Exit无法关掉程序。



Application.ExitThread 方法:

退出当前线程上的消息循环,并关闭该线程上的所有窗口(强制关闭程序)。不受CancelEventArgs参数影响。

Exits the message loop on the current thread and closes all windows on the thread.




C/S框架网|原创精神.创造价值.打造精品

扫一扫加微信
C/S框架网作者微信 C/S框架网|原创作品.质量保障.竭诚为您服务





上一篇 下一篇