예제 #1
0
        // Initialise the program to a known state
        // defaults to a client

        public TorrentMainForm()
        {
            InitializeComponent();
            this.manager = new ConnManager(11000, false);

            // Open the Id form to gather an id from the user
            using (IdForm idForm = new IdForm())
            {
                idForm.StartPosition = FormStartPosition.CenterParent;
                idForm.ShowDialog(this);

                id = idForm.GetID();
            }

            if (string.IsNullOrWhiteSpace(id))
            {
                this.Close();
            }
            peerConnectedList = new List <UIPeer>();
            uIUpdater         = new UIUpdater(dataGridView1, dataGridViewConnectedPeers, dataGridViewLatestTorrent);
        }
예제 #2
0
 public TorrentFile(string inId, IPAddress inIp, int inPort, UIUpdater inUiUpdate)
 {
     paused              = false;
     uiUpdate            = inUiUpdate;
     ip                  = inIp;
     port                = inPort;
     percentage          = "0";
     firstTime           = true;
     id                  = inId;
     fileName            = "";
     fileNameWithout     = "";
     hash                = null;
     hashString          = "";
     fileSize            = 0;
     pieces              = 0;
     pieceSize           = 0;
     amountOfFileAquired = 0;
     piecesDownloading   = new List <int>();
     peerList            = new List <PeerResponse>();
     parentPath          = System.IO.Directory.GetCurrentDirectory();
     parentPath          = parentPath + "\\" + id + "\\";
 }