Display 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; 
 
    if(thrd.Name == null) 
      Console.WriteLine("Main thread has no name."); 
    else 
      Console.WriteLine("Main thread is called: " + thrd.Name); 
 
  } 
}
Main thread has no name.










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