BackgroundWorker and CookieJar

tdhprestatyn

New member
Joined
Jun 19, 2009
Messages
1
Programming Experience
1-3
I am building an app that connects to a webservice that returns an XML file, and due to the lag I want to use a backgroundworker to connect and then return the data when its done, and also store the cookies in CookieJar so I can use one post to log in, and get the webservice to auth the session. However, I am completely stuck as I cant get BackgroundWorker to return anything other than a true or false when it completes. I am used to PHP now, until a few weeks ago it had been 5 years since I last used VB ( and it was vb6) so I am rusty.

Any help would be appreciated.

Thanks
tony
 
Er. You get the BGW to store the things in the jar

If you want progress out of a BGW, set WorkerReportsProgress to TRUE and then add a handler for the BGW.ProgressChanged event. You can pass objects in this event. Anything you put into bgw.ReportProgress(INTEGER_HERE, OBJECT_HERE) comes out in the e.progresspercentage and e.userstate properties

Also you can handle the RunWorkerCOmpleted event to run code when the DoWork finished for whatever reason. If it foinished because of an exception you can get the exception out of the e
 
Back
Top