C# 线程、timer例句

            Thread thread = new Thread(new ThreadStart(delegate()
            {
                oledbConn.Open();
                foreach (DataRow x in yxdms)
                {
                    toCut(x["yxdm"].ToString().Trim());
                }
                oledbConn.Close();
            }));
            thread.Start();

            //刷新状态显示
            System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
            timer.Interval = 1000;
            timer.Tick += (delegate(object sender2, EventArgs e2)
            {
                label2.Text = currYxdm;

            });

            timer.Start();
原文地址:https://www.cnblogs.com/ayao/p/2955752.html