static void Main(string[] args) { ThreadTest test = new ThreadTest(); // test.test(); // test.test1(); test.test2(); Console.ReadLine(); }
static void Main(string[] args) { ThreadTest test = new ThreadTest(); Thread thread = new Thread(new ThreadStart(test.MyThread)); //启动线程 thread.Start(); Console.ReadKey(); }
/// <summary> /// Thred测试按钮单击事件,带一个参数 /// </summary> /// <param name="sender">按钮单击事件对象</param> /// <param name="e">按钮单击事件参数信息</param> private void btn_Hello_Click(object sender, EventArgs e) { ThreadTest.StartTest("Hello"); }
/// <summary> /// Thred测试按钮单击事件,不带参数 /// </summary> /// <param name="sender">按钮单击事件对象</param> /// <param name="e">按钮单击事件参数信息</param> private void btn_Thread_Click(object sender, EventArgs e) { ThreadTest.StartTest(); }