English 中文(简体)
如何在申请被中止时关闭?
原标题:How to close thread when application deactivated?

我在一些页(例如,第1页)上用了7页。 当申请在本页而不是全球申请档案中停止使用时,我想结束这些内容。 当申请从其他网页上停止使用时,Nvavigate的网页仅上页。 从名称来看,Navigate的借页1 从点起。 我如何能够这样做? 或关闭这些深层的最佳做法是什么?

最佳回答

如果你的阅读是使用BackgroundWorker http://msdn.microsoft.com/en-us/library/system.componentmodel. 95backgroundworker.cancellationpending%28v=VS.9529.aspx”rel=“nofollow”

If you are creating your own Thread, you can emulate this behavior by setting a boolean flag that is checked periodically (in a loop or whatever) by your thread. What you shouldn t do is call Thread.Abort as that could leave you with corrupted state if you write to the isolated storage or a database.

问题回答

暂无回答




相关问题
Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Is reading from an XmlDocument object thread safe?

I was wondering if i could safely read from an XmlDocument object using SelectNodes() and SelectSingleNode() from multiple threads with no problems. MSDN says that they are not guaranteed to be ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...