C#: RunWorkerAsync() doesn't trigger DoWork()

前端 未结 4 1393
春和景丽
春和景丽 2021-01-21 03:28

I am writing a small forms based application to connect to an LDAP server, and I wanted the \"connect\" button to work in the background. So I was following the information and

4条回答
  •  误落风尘
    2021-01-21 04:18

    You are never wiring up the event.

       public Form1()
        {
            InitializeComponent();
            worker.DoWork += new DoWorkEventHandler(worker_DoWork);
        }
    

提交回复
热议问题