Пример #1
0
        static void Main(string[] args)
        {
            TorrentClient client = new TorrentClient
            {
                PeerId = "-CS1000-000000000000"
            };

            client.Start(6881);

            Torrent         torrent  = client.LoadTorrentFile("ubuntu-17.04-desktop-amd64.iso.torrent");
            TrackerResponse response = torrent.Announce();

            Console.WriteLine($"Success: {response.Success}");

            Console.Read();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("TorrentSharp Example");
            TorrentClient client = new TorrentClient();

            Console.WriteLine($"PeerId: {client.PeerId}");

            client.Start(6881);

            Torrent         torrent  = client.LoadTorrentFile("ubuntu-17.04-desktop-amd64.iso.torrent");
            TrackerResponse response = torrent.Announce();

            Console.WriteLine($"Success: {response.Success}");

            Peer peer = new Peer(client, torrent, response.Peers[0]);

            Console.Read();
        }