效果:

C# <wbr>backgroundWorker <wbr>多线程查询讯航班
调用web service接口,返回结果,在listview中显示。
代码:
using multiThread_airplane.ServiceReference1;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace multiThread_airplane
{
    public partial class Form1 : Form
    {
        BackgroundWorker bw = new BackgroundWorker();
        DataSet end;
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            listView1.Columns.Add("航空公司", 80, HorizontalAlignment.Center);
            listView1.Columns.Add("航班号", 80, HorizontalAlignment.Center);
            listView1.Columns.Add("出发机场", 150, HorizontalAlignment.Center);
            listView1.Columns.Add("到达机场", 150, HorizontalAlignment.Center);
            listView1.Columns.Add("出发时间", 80, HorizontalAlignment.Center);
            listView1.Columns.Add("到达时间", 80, HorizontalAlignment.Center);
            listView1.Columns.Add("经停", 70, HorizontalAlignment.Center);
            listView1.Columns.Add("飞行周期", 80, HorizontalAlignment.Center);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            bw.DoWork +=new DoWorkEventHandler(doworker);
            bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_completed);
            bw.RunWorkerAsync();
        }
        public void doworker(object sender,DoWorkEventArgs e)
        {
            try
            {
                DomesticAirlineSoapClient client = new DomesticAirlineSoapClient("DomesticAirlineSoap");
                end = client.getDomesticAirlinesTime(textBox1.Text, textBox2.Text, dateTimePicker1.Value.Year.ToString() + "-" + dateTimePicker1.Value.Month.ToString() + "-"+dateTimePicker1.Value.Day.ToString(),"");
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void worker_completed(object sender,RunWorkerCompletedEventArgs e)
        {
            DataTable dt = end.Tables[0];
            foreach(DataRow dr in dt.Rows)
            {
                listView1.Items.Add(new ListViewItem(new string[] { dr[0].ToString(), dr[1].ToString(), dr[2].ToString(), dr[3].ToString(), dr[4].ToString(), dr[5].ToString(), dr[6].ToString(), dr[7].ToString() }));
            }
        }
    }
}