NFly.BitsTransfer 1.0.0-alpha2

A .Net wrapper library for Windows Background Intelligent Transfer Service (BITS)

This is a prerelease version of NFly.BitsTransfer.
Install-Package NFly.BitsTransfer -Version 1.0.0-alpha2
dotnet add package NFly.BitsTransfer --version 1.0.0-alpha2
<PackageReference Include="NFly.BitsTransfer" Version="1.0.0-alpha2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NFly.BitsTransfer --version 1.0.0-alpha2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NFly.BitsTransfer

A .Net wrapper library for Windows Background Intelligent Transfer Service (BITS)

DEMO

DEMO

Features

  • Download Single File
  • Download Folder
  • Progress report
  • Estimated downloading time
  • Estimated downloading speed

Usage

var jobName = "YOUR_JOB_NAME"
var job = BitsJob.GetJob(jobName);

//remove existing job
if(job!=null){
  job.Cancel();  
}

//create job
job = BitsJob.Create(jobName);
job.Pause();
job.AddFile("REMOTE_FILE", "PATH_OF_LOCAL_FILE");

//watch progress
job.OnProgress += progress =>{
  var status = job.State;
  if(status == BitsJob.BG_JOB_STATE.BG_JOB_STATE_TRANSFERRED){
    //files transferred, mark job as completed
    job.Complete();

    Console.WriteLine("Job completed, you can access downloaded files now.");
    return;
  }

  Console.WriteLine("----");
  Console.WriteLine("BytesTotal: {0}",progress.BytesTotal);
  Console.WriteLine("BytesTransferred: {0}",progress.BytesTransferred);
  Console.WriteLine("Bytes Per Second: {0}",progress.EstimatedSpeed);
  Console.WriteLine("Remaining Seconds: {0}",progress.EstimatedTimeRemaining);
};

//pause job
job.Pause();

//resume job
job.Resume();

NFly.BitsTransfer

A .Net wrapper library for Windows Background Intelligent Transfer Service (BITS)

DEMO

DEMO

Features

  • Download Single File
  • Download Folder
  • Progress report
  • Estimated downloading time
  • Estimated downloading speed

Usage

var jobName = "YOUR_JOB_NAME"
var job = BitsJob.GetJob(jobName);

//remove existing job
if(job!=null){
  job.Cancel();  
}

//create job
job = BitsJob.Create(jobName);
job.Pause();
job.AddFile("REMOTE_FILE", "PATH_OF_LOCAL_FILE");

//watch progress
job.OnProgress += progress =>{
  var status = job.State;
  if(status == BitsJob.BG_JOB_STATE.BG_JOB_STATE_TRANSFERRED){
    //files transferred, mark job as completed
    job.Complete();

    Console.WriteLine("Job completed, you can access downloaded files now.");
    return;
  }

  Console.WriteLine("----");
  Console.WriteLine("BytesTotal: {0}",progress.BytesTotal);
  Console.WriteLine("BytesTransferred: {0}",progress.BytesTransferred);
  Console.WriteLine("Bytes Per Second: {0}",progress.EstimatedSpeed);
  Console.WriteLine("Remaining Seconds: {0}",progress.EstimatedTimeRemaining);
};

//pause job
job.Pause();

//resume job
job.Resume();

Release Notes

change nuget package structure to meet nuget standard.

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0-alpha2 255 12/14/2017
1.0.0-alpha1 456 3/31/2016