LibtorrentDotNet 1.1.0
dotnet add package LibtorrentDotNet --version 1.1.0
NuGet\Install-Package LibtorrentDotNet -Version 1.1.0
<PackageReference Include="LibtorrentDotNet" Version="1.1.0" />
paket add LibtorrentDotNet --version 1.1.0
#r "nuget: LibtorrentDotNet, 1.1.0"
// Install LibtorrentDotNet as a Cake Addin #addin nuget:?package=LibtorrentDotNet&version=1.1.0 // Install LibtorrentDotNet as a Cake Tool #tool nuget:?package=LibtorrentDotNet&version=1.1.0
LibtorrentDotNet
Overview
LibtorrentDotNet is a C++/CLI wrapper around libtorrent, designed for use in .NET applications. This wrapper allows .NET developers to leverage many of the core features of libtorrent in their projects.
Features
- Access to common libtorrent functionality through a .NET-friendly interface
- Easy integration with existing .NET projects targeting Windows
- High-performance BitTorrent operations
Installation
You can install this package using the NuGet Package Manager:
Install-Package LibtorrentDotNet
Usage
Here's a basic example of how to use LibtorrentDotNet:
using LibtorrentDotNet;
class Program
{
static void Main(string[] args)
{
using (var torrentSession = TorrentSession.Create())
{
torrentSession.TorrentStateUpdated += (sender, torrentStateUpdateEventArgs) =>
{
var status = torrentStateUpdateEventArgs.UpdatedTorrents[0];
if (status.State == TorrentState.Downloading)
{
Console.WriteLine($"Downloading torrent: {Math.Round(status.Progress * 100, 2)}%");
}
else
{
Console.WriteLine(status.State);
}
};
torrentSession.AddTorrent(new AddTorrentFromMagnetLinkRequest("your magnet link goes here", "a save directory path goes here"));
Console.WriteLine("Press any key to exit.");
Console.ReadLine();
}
}
}
Requirements
- .NET 8
- Windows 10 and later, x64 only
Building
Before building the solution, ensure that you have the following installed:
- vcpkg
- .NET 8 SDK
- Visual Studio 2022 (or your preferred IDE) with the following components:
- .NET desktop development workload
- Desktop development with C++ workload
- C++/CLI support for v143 build tools
- Install the libtorrent library using vcpkg
- Clone this repository
- Build the solution
Dependencies
This project uses the following third-party library:
libtorrent
libtorrent is a C++ library that provides a feature-complete implementation of the BitTorrent protocol.
- Author: Arvid Norberg and contributors
- License: BSD License
- Copyright: (c) 2003-2024 Arvid Norberg, all rights reserved.
The libtorrent library is used to handle torrent functionalities within this project. You can find more information about libtorrent on the official website or view its source code on GitHub.
License
This project is licensed under the BSD License. For more information, see the LICENSE.txt file in the root of this repository.
This project includes or depends on libtorrent, which is subject to its own license terms. See LICENSE.txt for details.
Special Thanks
Special thanks to the open-source community and all contributors of libtorrent for providing an excellent library that made this project possible.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release