How does .net backgroundworker work?
-
I import data from files in my application built in C#. If the files are not available, it sends out data import failure email. Instead I want to check if the files available 3 times and send failure email on 3rd time. I know one way is to use Backgroundworker but I'm not sure how. Any help is highly appreciated..
-
Answer:
This MSDN article describes in detail how to use BackgroundWorker: http://msdn.microsoft.com/en-us/library/cc221403(v=vs.95).aspx Attach all computationally heavy functions to DoWork event. Call RunWorkerASync() to trigger the DoWork event. If you want to update UI or write to log file after the task is done, do so through functions attached to RunWorkerCompleted event. If you do so outside the BW implemetation, that will happen as soon as RunWorkerASync() is called as BW runs in parallel thread. Make sure to detach all event handlers as attaching multiple times would make backgroundworker do the task multiple times
Prateek Shrivastava at Quora Visit the source
Related Q & A:
- How does "Nivo Slider" work?Best solution by Stack Overflow
- If i work in the republic of ireland but live in the north how does the tax work?Best solution by Yahoo! Answers
- How is net sales calculated?Best solution by wikihow.com
- How to apply for work permit to work in different countries?Best solution by Yahoo! Answers
- How is net income calculated?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.