using System;
using System.Threading;
namespace C17_2
{
public class Test
{
public static void ThreadA()
{
for (int i = 0; i < 3; i++)
{
Console.WriteLine("執行緒A:{0}",i);
}
}
public static void ThreadB() {
for (int i = 0; i < 3; i++)
{
Console.WriteLine("執行緒B:{0}",i);
}
}
public static void Main()
{
Console.WriteLine("開始啟動執行緒");
Thread a = new Thread(new ThreadStart(ThreadA));
Thread b = new Thread(new ThreadStart(ThreadB));
a.Start();
b.Start();
}
}
}
沒有留言:
張貼留言