How to kill all running threads in Silverlight?
How开发者_如何学C to kill all running threads in Silverlight?
You can't, the Abort
method of a Thread
object is marked as security critical and can't be called in Silverlight code.
If you want to kill the running of your own code then you could use the BackgroundWorker
class to run the code and place reasonable checks in the code for CancellationPending
being set. Other code can then call CancelAsync
to terminate it.
精彩评论