Display main thread's name : Main Thread : Thread C# Examples


C# Examples » Thread » Main Thread »

 

Display main thread's name









    
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);  
  
    }  
}
    
   
  
   



Output

Main thread has no name.


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» Main Thread