C# Program example to Show the Main Thread


Showing the main thread;-
 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;


namespace ConsoleApplication1
{
    class mainthread
    {
        static void Main(string[] args)
        {
            Thread th = Thread.CurrentThread;
            th.Name = “Main Thread”;
            Console.WriteLine(“the name of the main thread is:{0}”, th.Name);
            Console.ReadLine();
           
        }
    }
}

Add Comment