ParameterizedThreadStart 可接受输入参数。
如果函数需要输入一个或多个参数,则需ParameterizedThreadStart来启用进程。
1 using System; 2 using System.Threading; 3 public class Work 4 { 5 public static void Main() 6 { 7 Thread newThread = new Thread( 8 new ParameterizedThreadStart(doWork) 9 ); 10 newThread.start("456"); 11 12 public static void doWork(object ob) 13 { 14 Console.WriteLine("123" + ob.ToString()); 15 } 16 17 } 18 }