BackgroundWorker worker = new BackgroundWorker();
            worker.DoWork += (o, e) =>
            {

            };
            worker.RunWorkerCompleted += (o, e) =>
            {
              if (e.Error != null)
                    {
                        System.Windows.MessageBox.Show(e.Error.Message, "查询异常");
                    }

else

                {

                       //完成后执行

              }

            };
            worker.WorkerReportsProgress = true;
            worker.RunWorkerAsync();

posted on 2013-05-14 11:29  swarb  阅读(111)  评论(0编辑  收藏  举报