Yazılım Eğitim

Yeni Haberler

C # Locking When Running in a Program (backgroundworker) | Ebubekir Bastama


Have a nice day.

In this article we will explain the solution to the problem of mutilating in 2 different ways while processing the program in the program, and we will support with these 2 methods related video.
Now let's go to our methods:
BackgroundWorker.
async programming.
backgroundworker is a competent from visual studio friends you can access this competent from the toolbox.
1-) We find it by searching from Toolbox and add it to our form.
2-) After adding, we double-click on backgroundWorker ('backgroundWorker1_DoWork') or "DoWork" Events. Now we need to write the code we want into this event.
3-) We wrote everything and only 2 actions were left to do.
Run BackgroundWorker.
Adding (((CheckForIllegalCrossThreadCalls = false;))) to InitializeComponent ()).
4-) Where do you want to run the BackgroundWorker (Button click, Form load, etc.) we just write the following code.
"Backgroundworker1.runworkerasync ();"
5-) It is very easy to attach. We need to make our event come to the top of "InitializeComponent" (((CheckForIllegalCrossThreadCalls = false;))) Write this event now that the program will run freeze?
This is our article so many friends I mentioned above, the second method, "async", you can read this article in here. 

Hiç yorum yok