![]() In the above program, we created a module Module1 that contains a class MyThread and a function Main(). WriteLine ( "Hit Any Key to finish execution!!!" ) Thread_flag = True End Sub End Class Sub Main ( ) Dim MT As New MyThread ( ) Dim T1 As New Thread ( AddressOf MT. Sleep ( 500 ) End While End Sub Public Sub StopThread ( ) Private thread_flag As Boolean = False Public Sub ThreadFun ( ) While (thread_flag = False )Ĭonsole. The given program is compiled and executed successfully. The source code to kill a thread is given below. ![]() To kill a thread in VB.Net, here we implemented the program to stop running thread when a key is pressed by the user, if the user will not press the key then the thread will run indefinitely. Here, we are going to learn how to kill a thread in VB.Net?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |