Esempio n. 1
0
        private void BtnConfirmPathClick(object sender, EventArgs e)
        {
            string hiddenPath = PathName() + @".hidden\", newPath = PathName() + @"TorPdos\";

            if (Directory.Exists(PathName()) == true)
            {
                if (!Directory.Exists(hiddenPath) && chkCreateFolder.Checked == false)
                {
                    DiskHelper.SetRegistryValue("Path", PathName());
                    HiddenFolder dih = new HiddenFolder(hiddenPath);
                }
                else if (Directory.Exists(hiddenPath) && chkCreateFolder.Checked == false)
                {
                    DiskHelper.SetRegistryValue("Path", PathName());
                }
                else if (chkCreateFolder.Checked == true)
                {
                    DiskHelper.SetRegistryValue("Path", newPath);
                    DirectoryInfo di  = Directory.CreateDirectory(newPath);
                    HiddenFolder  dih = new HiddenFolder(newPath + @".hidden\");
                }

                if (IdHandler.UserExists())
                {
                    Login();
                }
                else
                {
                    Create();
                }
            }
        }
Esempio n. 2
0
        public UploadManager(StateSaveConcurrentQueue <P2PFile> queue, NetworkPorts ports,
                             ConcurrentDictionary <string, Peer> peers)
        {
            this._queue = queue;
            this._ports = ports;
            this._peers = peers;

            this._waitHandle = new ManualResetEvent(false);
            this._queue.ElementAddedToQueue += QueueElementAddedToQueue;
            _hiddenFolder = new HiddenFolder(_path + @".hidden");

            this._path = DiskHelper.GetRegistryValue("Path");
            Peer.PeerSwitchedOnline += PeerWentOnline;
        }
Esempio n. 3
0
        public Network(int port, Index index, string path = "C:\\TorPdos\\")
        {
            this._port         = port;
            this._path         = path;
            this._index        = index;
            this._peerFilePath = path + @".hidden\peer.json";
            _hiddenPath        = new HiddenFolder(_path + @".hidden\");

            LoadPeer();
            _localtionPath = _path + @".hidden\location.json";
            LoadLocation();

            _deletionQueue = StateSaveConcurrentQueue <string> .Load(_path + @".hidden\deletion.json");

            _upload = StateSaveConcurrentQueue <P2PFile> .Load(_path + @".hidden\upload.json");

            _download = StateSaveConcurrentQueue <P2PFile> .Load(_path + @".hidden\download.json");
        }