Exemple #1
0
        /// <summary>
        /// Saves this torrent information to a file on disk.
        /// </summary>
        /// <param name="filePath">The path to the file to create.</param>
        public void SaveToFile(string filePath)
        {
            if (filePath == null)
            {
                throw new ArgumentNullException("filePath");
            }

            var torrentInfo = Save();

            BEncoding.EncodeToFile(torrentInfo, filePath);
        }
Exemple #2
0
        public static void SafeToFile(Torrent torrent)
        {
            var obj = TorrentToBEncodingObject(torrent);

            BEncoding.EncodeToFile(obj, $"{torrent.Name}.{TORRENT_EXTENSION_FILE}");
        }