Exemplo n.º 1
0
 public void Clear()
 {
     try
     {
         _proxyManager.Clear();
     }
     catch (Exception exception)
     {
         _logger.Debug("error while clear proxies");
         _logger.Error(exception);
     }
 }
Exemplo n.º 2
0
        private void LoadProxies()
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Title  = "Choose a file containing a list of proxies...";
                ofd.Filter = "Text Files (*.txt)|*.txt";

                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    _proxyManager.Clear();

                    foreach (var line in File.ReadAllLines(ofd.FileName))
                    {
                        if (line.Contains(":"))
                        {
                            var data = line.Split(':');

                            if (!Properties.Settings.Default.ProxiesLogin)
                            {
                                _proxyManager.QueueProxy(data[0], data[1]);
                            }
                            else
                            {
                                _proxyManager.QueueProxy(data[0], data[1], data[2], data[3]);
                            }
                        }
                    }
                    loadProxiesBtn.Text = string.Format("Load Proxies ({0})", _proxyManager.Count);

                    if (_accountManager.Count > 0 && (_proxyManager.Count > 0 || !loadProxiesBtn.Visible))
                    {
                        checkBtn.Enabled = true;
                    }
                    else
                    {
                        checkBtn.Enabled = false;
                    }

                    UpdateInfos(true);
                }
            }
        }