YouarecreatingaWindowsFormsapplicationbyusingthe.NetFramework3.5.YoucreateaninstanceofaBackgroundworkercomponentnamedbackgroundWorker1toprocessoperationsthattakealongtime.Youdiscoverthatwhentheapplicationattemptstoreporttheprogress,youreceiveaSystem.InvalidOperationExceptionexceptionwhenexecutingthebackgroundWorker1.ReportProgressmethod.YouneedtoconfiguretheBackgroundWorkercomponentappropriatelytopreventtheapplicationfromgeneratingexceptions.Whatshouldyodo?()

A.SettheResultpropertyoftheDoWorkEventArgsinstancetoTruebeforeyouattempttoreporttheprogress. B.SettheCancellationPendingpropertyofbackgroundWorker1toTruebeforeyouattempttoreportthebackgroundprocess C.SettheWorkerReportsProgresspropertyofbackgroundWorker1toTruebeforeyouattempttoreportthebackgroundprocess. D.ReporttheprogressofthebackgroundprocessinthebackgroundWorker1_ProgressChangedevent.

时间:2023-12-20 10:24:51

相似题目