O'Reilly logo

C# 2008 and 2005 Threaded Programming: Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - Using a BackgroundWorker to cancel the job

You are using a wireless connection to detect intruders in your hacking network while breaking the code. If an intrusion is detected spying your network, you must abort the code breaking process, and you will avoid the detection of your location by the spies. Hiding the controls does not stop the code breaking process. Therefore, it is very important to provide the application with a fast cancellation procedure. Hurry up, the FBI is on your tail!

We are going to make some changes to our example to allow the user to cancel the loop at any time without delegates or callbacks, using the features provided by the BackgroundWorker component:

  1. Open the project, CodeBreakerApplication.
  2. Set the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required