Mega Code Archive

 
Categories / C# Tutorial / Thread
 

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);     } } Param worker: Test