C# Stop BackgroundWorker
问题 I have question about backgroundworker. I have endless loop in backgroundworker. How can I stop it? 回答1: Change it to a non-endless loop. The BackgroundWorker has built-in support for cancellation. To cancel a background worker call BackgroundWorker.CancelAsync. Also you need to modify the worker code to check for cancellation as mentioned in the documentation: CancelAsync submits a request to terminate the pending background operation and sets the CancellationPending property to true. When