Esempio n. 1
0
        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (acc != null)
            {
                this.Update();
            }



            myCons.Text = "load data" + Environment.NewLine;
            var loadAcc = new LoadAccount()
            {
                Path = this.Path
            };

            acc = loadAcc.GetAccountList(Path + '/' + _blaster, Path + '/' + _base, Path);

            // we put all
            var allmail = acc.Where(ex => ex.Email.Contains(".gmail.com")).ToList();


            if (acc == null)
            {
                MessageBox.Show("dont find gmail  password");
            }

            dataGridView.DataSource         = acc;
            dataGridView.Columns[2].Visible = false;
            dataGridView.Columns[3].Visible = false;

            this.Text = acc.Count.ToString() + "_accounts ";
            foreach (DataGridViewColumn column in dataGridView.Columns)
            {
                dataGridView.Columns[column.Name].SortMode = DataGridViewColumnSortMode.Automatic;
            }
        }
Esempio n. 2
0
        private void tryFindLostedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //load acc

            myCons.Text = "load data" + Environment.NewLine;
            var loadAcc = new LoadAccount()
            {
                Path = this.Path
            };

            acc = loadAcc.GetAccountList(Path + '/' + _blaster, Path + '/' + _base, Path);

            var allGmail = acc.FindAll(w => w.Email.Contains("@gmail.com"));

            List <string> done = new List <string>();

            foreach (var acc in allGmail)
            {
                myCons.Text = acc.Email;
                string clearEmail = acc.Email.Replace(".", "");
                if (done.Contains(clearEmail))
                {
                    continue;
                }
                done.Add(clearEmail);

                string pass = (new Settings().GetEmailPassword(acc.Email) == null) ? acc.EmailPassword : new Settings().GetEmailPassword(acc.Email);

                MailServer oServer = new MailServer(new Settings().GetEmailHost(acc.Email), acc.Email, pass, ServerProtocol.Pop3);
                MailClient oClient = new MailClient("TryIt");
                // Please add the following codes:
                oServer.SSLConnection = true;
                oServer.Port          = 995;
                acc.Time = DateTime.Now;
                try
                {
                    oClient.Connect(oServer);
                    MailInfo[] infos = oClient.GetMailInfos();
                    infos = infos.Reverse().ToArray();
                    for (int i = 0; i < 75; i++)
                    {
                        string   resetEmailUrl = null;
                        MailInfo info          = infos[i];
                        Mail     oMail         = oClient.GetMail(info);
                        if ((DateTime.Today - oMail.SentDate).TotalHours > 24)
                        {
                            continue;
                        }

                        var subj = oMail.Subject;
                        var rep  = oMail.To[0].Address;
                        myCons.Text += i.ToString();

                        var x = allGmail.FindAll(em => em.Email == rep);

                        if (allGmail.FindAll(em => em.Email == rep).Count > 0)
                        {
                            continue;
                        }

                        //false
                        if (oMail.From.Address.ToString().Contains("pinterest"))
                        {
                            resetEmailUrl = new GetLink().FindLink(oMail.HtmlBody);
                        }


                        if (resetEmailUrl != null)
                        {
                            TryReset(acc, resetEmailUrl, rep, "missed.txt");

                            // yea we do reset here
                        }
                        File.AppendAllText(this._res + '/' + acc.Nick + ".html",
                                           "<h1>" + acc.Email + "</h1><h3>" + oMail.From.Address + "</h3><h3>" + oMail.ReceivedDate + "</h3><br>" + oMail.HtmlBody + "<br><br><br>");

                        // Mark email as deleted from POP3 server.
                        oClient.Delete(info);
                    }

                    // Quit and pure emails marked as deleted from POP3 server.
                    oClient.Quit();
                }
                catch (Exception ep)
                {
                    File.AppendAllText(this._res + System.IO.Path.DirectorySeparatorChar + "total_bad.txt", acc.Email + Environment.NewLine);
                }
            }
            //naiti vse gmail
            // proverit vse pochti gmail gde netu acc
        }