Answers for "c# get current thread"

C#
-1

c# current thread id

using System.Threading;
var curThread = Thread.CurrentThread.ManagedThreadId;
Console.WriteLine($"The current thread is: {curThread}");
Posted by: Guest on August-22-2020
0

c# update control from another thread

// Running on the worker thread
string newText = "abc";
form.Label.Invoke((MethodInvoker)delegate {
    // Running on the UI thread
    form.Label.Text = newText;
});
// Back on the worker thread
Posted by: Guest on March-30-2020

C# Answers by Framework

Browse Popular Code Answers by Language