What's the difference between Invoke() and BeginInvoke()

前端 未结 6 1900
无人共我
无人共我 2020-11-22 01:14

Just wondering what the difference between BeginInvoke() and Invoke() are?

Mainly what each one would be used for.

EDIT: What is t

6条回答
  •  独厮守ぢ
    2020-11-22 02:13

    Delegate.BeginInvoke() asynchronously queues the call of a delegate and returns control immediately. When using Delegate.BeginInvoke(), you should call Delegate.EndInvoke() in the callback method to get the results.

    Delegate.Invoke() synchronously calls the delegate in the same thread.

    MSDN Article

提交回复
热议问题