c# thread

来源:互联网 发布:remark软件 编辑:程序博客网 时间:2024/06/06 13:04
//设置isbackground,关闭主程序,关闭线程Thread thread;        private void button1_Click(object sender, EventArgs e)        {            try            {                thread = new Thread(new ThreadStart(accept));                thread.IsBackground = true;                thread.Start();            }            catch (Exception)            {                Console.WriteLine("链接失败");            }        }

0 0
原创粉丝点击