N
N
nanosem2017-05-16 23:10:25
PHP
nanosem, 2017-05-16 23:10:25

How to switch between threads in c# .net to update GUI?

I have a thread (not the main one) that is working with the treeView, so here's how I call the main thread to update the treeView I
read about delegates, invoke ... I can't figure it out without an example yet
Something like this:
....
Switched to main thread
{
treeView.items.add(item);
}
Working on the background thread....

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
SagePtr, 2018-07-29
@crarerw

Very much like a backdoor, especially considering this: and the fact that initially the arguments sent to the function are collected from the $_COOKIE, $_POST arrays, which can be sent by any user.

R
Rsa97, 2018-07-29
@Rsa97

And what is there to disassemble? All name => value pairs are taken from cookies and post, the values ​​are converted from hexadecimal to binary notation, xed with a key, divided into substrings by # and, if the number of elements in the array turned out to be a multiple of three, then an attempt is made to execute the second element of the array with eval argument from the third.

J
Johnny Gat, 2017-05-16
@nanosem

Another such option:

this.Invoke(new Action(() =>
 {
    //  работа с treeView
}));

A
Artem, 2017-05-17
@devspec

Do not throw pissing slippers on))
And apply only when you understand what you are doing
Control.CheckForIllegalCrossThreadCalls = False

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question