Пример #1
0
        private void LoadAccounts()
        {
            using (OpenFileDialog ofd = new OpenFileDialog())
            {
                ofd.Title  = "Choose a file containing a list of accounts...";
                ofd.Filter = "Text Files (*.txt)|*.txt";

                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    checkBtn.Enabled  = false;
                    exportBtn.Visible = false;
                    listView1.Items.Clear();
                    _accountManager.Clear();
                    _accountsChecker.ResetCounters();

                    foreach (String line in File.ReadAllLines(ofd.FileName))
                    {
                        if (line.Contains(":"))
                        {
                            String email = line.Split(':')[0];
                            String pass  = line.Split(':')[1];

                            if (email.Contains('@') && pass.Length != 0)
                            {
                                _accountManager.QueueAccount(email, pass);
                            }
                        }
                    }
                    loadAccBtn.Text = String.Format("Load Accounts ({0})", _accountManager.Count);

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

                    UpdateInfos(true);
                }
            }
        }