Thread method with parameter : Thread Creation : Thread C# Examples


C# Examples » Thread » Thread Creation »

 

Thread method with parameter









    
using  System;
using  System.Collections.Generic;
using  System.Diagnostics;
using  System.IO;
using  System.Reflection;
using  System.Runtime;
using  System.Runtime.CompilerServices;
using  System.Security;
using  System.Text;

public  class  MainClass
{
        public  static  void  Main()
        {
                Thread  paramThread  =  new  Thread(ParameterizedWorkerOperation);
                paramThread.Start("Test");

                paramThread.Join();
        }
        private  static  void  ParameterizedWorkerOperation(object  o)
        {
                Console.WriteLine("Param  worker:  {0}",  o);
        }
}
    
   
  
   



Output

Param worker: Test


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Thread
» Thread Creation