C# 任务 数据加载不影响其他操作

 

        private void button1_Click(object sender, EventArgs e)
        {
            //this.timer1.Enabled = true;
            Task t1 = new Task(set);
            t1.Start();
        }
        public void set()
        {
            while (true)
            {
                Thread.Sleep(1000);
                this.textBox2.Text = DateTime.Now.ToString("ffffff");
            }          
        }

 

posted @ 2017-11-15 09:55  蓝雨冰城  阅读(197)  评论(0编辑  收藏  举报