https://github.com/collapselauncher/hi3helper.http
Http downloader with Multi-Session support
https://github.com/collapselauncher/hi3helper.http
Last synced: 9 months ago
JSON representation
Http downloader with Multi-Session support
- Host: GitHub
- URL: https://github.com/collapselauncher/hi3helper.http
- Owner: CollapseLauncher
- License: mit
- Created: 2022-06-26T14:19:55.000Z (over 3 years ago)
- Default Branch: v2
- Last Pushed: 2025-06-07T14:02:13.000Z (10 months ago)
- Last Synced: 2025-06-07T15:18:34.392Z (10 months ago)
- Language: C#
- Size: 357 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hi3Helper.Http
Http downloader wrapper with Multi-Session support
## Usage
### Single-session
```C#
Http client = new Http();
await client.Download("http://yourURL", "C:\yourOutputData");
```
### Single-session using ``Stream``s
```C#
using (MemoryStream stream = new MemoryStream())
{
Http client = new Http();
await client.Download("http://yourURL", stream);
// Doing something with the stream here
}
```
### Multi-session
```C#
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
```C#
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
```C#
private static void YourProgress(object? sender, DownloadEvent e)
{
Console.Write("\r{0}%", e.ProgressPercentage);
}
```
Other usages will be published soon.