This project is read-only.

Help: Cant get the file in my destination folder using sharpBITS

Dec 18, 2012 at 4:24 AM

Hi All, I am quite new using sharpBITS . I am using the last version. I downloaded the sources and rebuilt them to get the dll file then wrote the following code in my application under download button. changed the priority to foreground, However I cant get the File in my destination. I don know wut is missing. please help me as I need it urgently.

help is much appreciated in advance.

here is the code:

BitsManager manager = new BitsManager();

manager.EnumJobs(JobOwner.CurrentUser);

 BitsJob newJob = manager.CreateJob("Download", JobType.Download);

 newJob.Priority = JobPriority.ForeGround;            newJob.AddFile("http://localhost/test1/Images2/Desert.jpg",@"C:\Users\myuser\Desktop\test.jpg");

 newJob.Resume();
 newJob.Complete();

Dec 18, 2012 at 2:14 PM

if you call Complete right after Resume, it would just end the download job before anything has been downloaded. You will need to monitor the download progress and call Complete only after the job has reached JobState.Transferred

Dec 20, 2012 at 3:43 AM

Thank you for help. I called complete() from onjobtrasfered event handeler. it is working well now.