Set main thread's name : Main Thread « Thread « C# / CSharp Tutorial






using System; 
using System.Threading; 
 
class MainClass { 
  public static void Main() { 
    Thread thrd = Thread.CurrentThread; 
 
    thrd.Name = "Main Thread"; 
 
    Console.WriteLine("Main thread is now called: " + thrd.Name); 
  } 
}
Main thread is now called: Main Thread








20.12.Main Thread
20.12.1.Get the main thread
20.12.2.Display main thread's name
20.12.3.Display main thread's priority
20.12.4.Set main thread's name
20.12.5.Set the main thread's priority