110,566
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace Ex_20_4
{
class Program
{
static void Main(string[] args)
{
MyThreadClass o1 = new MyThreadClass("hackcat1,我的优先级是:Normal!");
Thread t1 = new Thread(o1.ThreadMain);
t1.Priority = ThreadPriority.Normal;
t1.Start();
MyThreadClass o2 = new MyThreadClass("hackcat2,我的优先级是:Normal!");
Thread t2 = new Thread(o2.ThreadMain);
t2.Priority = ThreadPriority.Normal;
t2.Start();
MyThreadClass o3 = new MyThreadClass("hackcat3,我的优先级是:Normal!");
Thread t3 = new Thread(o3.ThreadMain);
t3.Priority = ThreadPriority.Normal;
t3.Start();
MyThreadClass o4 = new MyThreadClass("hackcat4,我的优先级是:Normal!");
Thread t4 = new Thread(o4.ThreadMain);
t4.Priority = ThreadPriority.Normal;
t4.Start();
Console.Read();
}
}
public class MyThreadClass
{
private String Msg;
public MyThreadClass(String Msg)
{
this.Msg = Msg;
}
public void ThreadMain()
{
Console.WriteLine("字段Msg的值是{0}", Msg);
}
}
}