创建线程并且启用

1、创建线程(全局)

  private Thread LookPictureThread;

2 创建启动线程的方法 (放在一起方便管理)

 private void StartThread()
        {
            if (LookPictureThread == null)
            {
                LookPictureThread = new Thread(new ThreadStart(lookPicture));
                LookPictureThread.IsBackground = true;
                LookPictureThread.Start();
            }
            
        }

 

3 启动线程   直接调用StartThread()方法即可

posted @ 2019-04-29 11:11  紫藤球球  阅读(115)  评论(0编辑  收藏  举报