我正在尝试使用 C# 创建一个带有 monotorrent 包的 torrent 文件。
我已经使用 torrent 创建器创建了 torrent 文件,但我想添加一些在 torrent 创建器方法或属性中找不到的其他选项。
我正在寻找的选项:
- 添加跟踪网址(S),
- 网络种子 URL(S),
- 资源,
- 优化对齐。
这是我的代码片段:
string filepath = ofd.FileName;
PathDirectoryTxt.Text = filepath;
MonoTorrent.Common.TorrentCreator torrentcreaotr = new MonoTorrent.Common.TorrentCreator();
ITorrentFileSource fileSource = new TorrentFileSource(filepath);
torrentcreaotr.Comment = CommentsRichTxt.Text;
torrentcreaotr.CreatedBy = "Google using " + VersionInfo.ClientVersion;
torrentcreaotr.Publisher = "www.itsitus.com";
if ((PrivateTorrentCheckbox.Checked))
{
torrentcreaotr.Private = true;
}
else if (!PrivateTorrentCheckbox.Checked)
{
torrentcreaotr.Private = false;
}
string savepath = sfd.FileName;
torrentcreaotr.Create(fileSource, savepath);
MessageBox.Show("torrent file has been created successfully !");