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();