C#线程

 private Thread t;
        public Form1()
        {
            InitializeComponent();

            ThreadStart ts = new ThreadStart(Do);
            t = new Thread(ts);
            t.Start();
            timer1.Start();
        }

        public void Do()
        {
            while (true)
            {

                Timer tm = new System.Windows.Forms.Timer();

                //........
                t.Join(100000);
            }
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            for (int i = 0; i <= 10000; i++)
            {
                System.Threading.Thread.Sleep(10);
            }
        }

posted @ 2010-09-16 17:24  Sue_娜  阅读(137)  评论(0编辑  收藏  举报