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

namespace ConsoleTestThread
{
public delegate void ParameterizedThreadStart(object obj);

class Program
{
static void Main(string[] args)
{
Thread t = new Thread(Go);
Thread tName = new Thread(delegate() { GoTo("chenou", "I want to have many money"); });
t.Start(true);
tName.Start();
Go(false);

Console.ReadLine();
}

static void Go(object upperCasr)
{
bool upper = (bool)upperCasr;
Console.WriteLine(upper ? "HELLO!" : "hello!");
}

static void GoTo(string name, string word)
{
Console.WriteLine("My Name is " + name + "--- I Sad:" + word);
}

}
}

 

posted on 2011-11-20 20:24  小角色  阅读(288)  评论(0)    收藏  举报