Пример #1
0
	private void openMenuItem_Click(object sender, System.EventArgs e)
	{
		WinForms.OpenFileDialog dialog = new WinForms.OpenFileDialog();
		dialog.Title = "Open torrent file";
		dialog.Filter = @"Torrent file (*.torrent)|*.torrent|All files (*.*)|*.*";
		if (dialog.ShowDialog(this) == WinForms.DialogResult.OK)
		{
			BT.Torrent torrent = btsession.CreateTorrent( dialog.FileName );

			this.torrentListView.Items.Add(new TorrentListViewItem(torrent));

			torrent.PeerConnected += new BT.TorrentPeerConnectedCallback(OnPeerConnected);

			torrent.CheckFileIntegrity( true );
			torrent.Start();
		}
	}