Reference: http://www.cnblogs.com/chendaoyin/archive/2013/06/27/3159211.html
1. Turn on a sub-thread
1 // to open a child thread, the child thread invokes the method 2 New Thread (Method); 3 true ; 4 th. Start ();
2. Thread-handling functions
1 Public voidMethod ()2 {3 Try4 { }5 Catch(Exception ex)6 { 7 MessageBox.Show (ex. ToString (());8 }9 finallyTen { One Th.abort (); A } -}
The Exception ex here captures the system exception, but the thread uses the Abort method to close the thread during execution, prompting
System.Threading.ThreadAbortException: Aborting thread the error.
Workaround:
1 Public voidMethod ()2 {3 Try4 { }5 catch(ThreadAbortException ex) 6 {7 //do not operate8 }9 Catch(Exception ex)Ten { One MessageBox.Show (ex. ToString (()); A } - finally - { the Th.abort (); - } -}
C # error System.Threading.ThreadAbortException: Aborting thread