CurrentThread : Current Thread : Thread C# Examples


C# Examples » Thread » Current Thread »

 

CurrentThread









    
using  System;
using  System.Threading;

class  MainClass
{
    //  [MTAThread]
    [STAThread]
    static  void  Main(string[]  args)
    {
        Thread  primaryThread  =  Thread.CurrentThread;

        primaryThread.Name  =  "ThePrimaryThread";

        Console.WriteLine("Thread  Name:  {0}",  primaryThread.Name);
        Console.WriteLine("Alive:  {0}",  primaryThread.IsAlive);
        Console.WriteLine("Priority  Level:  {0}",  primaryThread.Priority);            
        Console.WriteLine("Thread  State:  {0}",  primaryThread.ThreadState);
    }
}
    
   
  
   



Output

Thread Name: ThePrimaryThread
Alive: True
Priority Level: Normal
Thread State: Running


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» Current Thread