如何完全停止螺纹力 [英] How to Stop Thread force Fully
本文介绍了如何完全停止螺纹力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经编写了一个使用线程的VB .NET应用程序.我以为
当用户关闭主窗口时(MainForm.closed事件
发生,并且我称为application.exit),所有正在运行的线程都必须中止,
但令我惊讶的是,当
时,运行线程不会停止
application.exit被调用.
请帮助
感谢
I have written a VB .NET app, which uses threads. I thought
that when the user closes the main window (when MainForm.closed event
occures, and I call application.exit) all running threads must abort,
but to my great surprise, running threads do not stop when
application.exit is called.
Please Help
Thanks
推荐答案
在.NET中,主应用程序在主线程中运行.您应该使用Abort
方法在MainForm_Closing
事件中停止线程.
In .NET the main application is running in main thread. You should stop your threads in yourMainForm_Closing
event by usingAbort
method.
这篇关于如何完全停止螺纹力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文