using System;
using System.Collections.Generic;
using
System.Linq;
using System.Text;
using System.Threading;
namespace ConsoleApplication
{
class
Program
{
static void Main(string[] args)
{
////线程方法1
//if (ThreadPool.QueueUserWorkItem(new WaitCallback(Program.WritePara),
"这是传进去的参数"))
//{
//
Console.WriteLine("ok:");
//
Console.Read();
//}
//线程方法2
Thread th = new Thread(new
ThreadStart(Write));
th.Start();
//线程方法3
Thread thread = new Thread(new
ParameterizedThreadStart(WritePara));
thread.Start("Thread thread = new Thread( new
ParameterizedThreadStart(WritePara))有参传递");
}
protected static void
WritePara(object para)
{
Console.WriteLine("hello:" +
para);
}
private static void
Write()
{
Console.WriteLine(" Thread th = new Thread(new
ThreadStart(Write));无参线程调用");
}
}
}