Skip to content

CollapseLauncher/Hi3Helper.Http

Repository files navigation

Hi3Helper.Http

Http downloader wrapper with Multi-Session support

Usage

Single-session

Http client = new Http();
await client.Download("http://yourURL", "C:\yourOutputData");

Single-session using Streams

using (MemoryStream stream = new MemoryStream())
{
    Http client = new Http();
    await client.Download("http://yourURL", stream);
    
    // Doing something with the stream here
}

Multi-session

int Session = 4;
Http client = new Http();
await client.DownloadMultisession("http://yourURL", "C:\yourOutputData", Session);
await client.MergeMultisession("C:\yourOutputData");

Using DownloadProgress event to display download progress

In your method

public static async Task Main()
{
    Http client = new Http();
    client.DownloadProgress += YourProgress;
    // Can be used with DownloadMultisession() as well
    await client.Download("http://yourURL", "C:\yourOutputData");
    await client.DownloadProgress -= YourProgress;
}

In your YourProgress event method

private static void YourProgress(object? sender, DownloadEvent e)
{
    Console.Write("\r{0}%", e.ProgressPercentage);
}

Other usages will be published soon.

About

Http downloader with Multi-Session support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages