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

前端 未结 4 1377
春和景丽
春和景丽 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:14

    You have not set

    worker.DoWork += new DoWorkEventHandler(worker_DoWork);

    before calling worker.RunAsync()

提交回复
热议问题